CloneSet36


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
91240.956class_member_declarations[5]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
110618
src/NHibernate.Test/UtilityTest/JoinedEnumerableFixture.cs
29112
src/NHibernate.Test/UtilityTest/JoinedEnumerableGenericFixture.cs
Clone Instance
1
Line Count
106
Source Line
18
Source File
src/NHibernate.Test/UtilityTest/JoinedEnumerableFixture.cs

                /// <summary>
                /// Test that the JoinedEnumerable works with a single wrapped
                /// IEnumerable as expected when fully enumerating the collection.
                /// </summary>
                [Test]
                public void WrapsSingle()
                {
                        int[] expected = new int[] { 1, 2, 3
                                                   } ;
                        EnumerableTester first;
                        JoinedEnumerable joined = InitSingle( out first);

                        int index = 0;

                        foreach (int actual in joined)
                        {
                                Assert.AreEqual(expected[index], actual, "Failure at " + index.ToString());
                                index++;
                        }

                        Assert.AreEqual(expected.Length, index, "Every expected value was found");
                        Assert.IsTrue(first.WasDisposed, "should have been disposed of.");
                }

                /// <summary>
                /// Test that the wrapped IEnumerator has Dispose called even when
                /// the JoinedEnumerator doesn't enumerate all the way through the
                /// collection.
                /// </summary>
                [Test]
                public void WrapsSingleBreak()
                {
                        int[] expected = new int[] { 1, 2, 3
                                                   } ;
                        EnumerableTester first;
                        JoinedEnumerable joined = InitSingle( out first);

                        foreach (int actual in joined)
                        {
                                Assert.AreEqual(expected[0], actual, "first one was not what was expected.");
                                break;
                        }

                        // ensure that the first was disposed of even though we didn't enumerate
                        // all the way through
                        Assert.IsTrue(first.WasDisposed, "should have been disposed of.");
                }

                /// <summary>
                /// Test that the JoinedEnumerable works with multiple wrapped
                /// IEnumerable as expected when fully enumerating the collections.
                /// </summary>
                [Test]
                public void WrapsMultiple()
                {
                        int[] expected = new int[] { 1, 2, 3, 4, 5, 6
                                                   } ;
                        EnumerableTester first;
                        EnumerableTester second;
                        JoinedEnumerable joined = InitMultiple( out first, out second);

                        int index = 0;

                        foreach (int actual in joined)
                        {
                                Assert.AreEqual(expected[index], actual, "Failure at " + index.ToString());
                                index++;
                        }

                        Assert.AreEqual(expected.Length, index, "Every expected value was found");
                        Assert.IsTrue(first.WasDisposed, "first should have been disposed of.");
                        Assert.IsTrue(second.WasDisposed, "second should have been disposed of. ");
                }

                /// <summary>
                /// Test that the JoinedEnumerable works with multiple wrapped
                /// IEnumerable as expected when breaking out.
                /// </summary>
                [Test]
                public void WrapsMultipleBreak()
                {
                        // break in the first IEnumerator
                        WrapsMultipleBreak(2);

                        // ensure behavior is consistent if break in 2nd IEnumerator
                        WrapsMultipleBreak(4);
                }

                private void WrapsMultipleBreak(int breakIndex)
                {
                        int[] expected = new int[] { 1, 2, 3, 4, 5, 6
                                                   } ;
                        EnumerableTester first;
                        EnumerableTester second;
                        JoinedEnumerable joined = InitMultiple( out first, out second);

                        int index = 0;

                        foreach (int actual in joined)
                        {
                                Assert.AreEqual(expected[index], actual, "Failure at " + index.ToString());
                                index++;
                                if (index == breakIndex)
                                {
                                        break;
                                }
                        }

                        Assert.IsTrue(first.WasDisposed, "first should have been disposed of.");
                        Assert.IsTrue(second.WasDisposed, "second should have been disposed of. ");
                }



Clone Instance
2
Line Count
91
Source Line
12
Source File
src/NHibernate.Test/UtilityTest/JoinedEnumerableGenericFixture.cs

                [Test]
                public void WrapsSingle()
                {
                        int[] expected = new int[] { 1, 2, 3
                                                   } ;
                        EnumerableTester<int> first;
                        JoinedEnumerable<int> joined = InitSingle( out first);

                        int index = 0;

                        foreach (int actual in joined)
                        {
                                Assert.AreEqual(expected[index], actual, "Failure at " + index);
                                index++;
                        }

                        Assert.AreEqual(expected.Length, index, "Every expected value was found");
                        Assert.IsTrue(first.WasDisposed, "should have been disposed of.");
                }

                [Test]
                public void WrapsSingleBreak()
                {
                        int[] expected = new int[] { 1, 2, 3
                                                   } ;
                        EnumerableTester<int> first;
                        JoinedEnumerable<int> joined = InitSingle( out first);

                        foreach (int actual in joined)
                        {
                                Assert.AreEqual(expected[0], actual, "first one was not what was expected.");
                                break;
                        }

                        Assert.IsTrue(first.WasDisposed, "should have been disposed of.");
                }

                [Test]
                public void WrapsMultiple()
                {
                        int[] expected = new int[] { 1, 2, 3, 4, 5, 6
                                                   } ;
                        EnumerableTester<int> first;
                        EnumerableTester<int> second;
                        JoinedEnumerable<int> joined = InitMultiple( out first, out second);

                        int index = 0;

                        foreach (int actual in joined)
                        {
                                Assert.AreEqual(expected[index], actual, "Failure at " + index);
                                index++;
                        }

                        Assert.AreEqual(expected.Length, index, "Every expected value was found");
                        Assert.IsTrue(first.WasDisposed, "first should have been disposed of.");
                        Assert.IsTrue(second.WasDisposed, "second should have been disposed of. ");
                }

                [Test]
                public void WrapsMultipleBreak()
                {
                        // break in the first IEnumerator
                        WrapsMultipleBreak(2);

                        // ensure behavior is consistent if break in 2nd IEnumerator
                        WrapsMultipleBreak(4);
                }

                private static void WrapsMultipleBreak(int breakIndex)
                {
                        int[] expected = new int[] { 1, 2, 3, 4, 5, 6
                                                   } ;
                        EnumerableTester<int> first;
                        EnumerableTester<int> second;
                        JoinedEnumerable<int> joined = InitMultiple( out first, out second);

                        int index = 0;

                        foreach (int actual in joined)
                        {
                                Assert.AreEqual(expected[index], actual, "Failure at " + index);
                                index++;
                                if (index == breakIndex)
                                {
                                        break;
                                }
                        }

                        Assert.IsTrue(first.WasDisposed, "first should have been disposed of.");
                        Assert.IsTrue(second.WasDisposed, "second should have been disposed of. ");
                }



Clone AbstractionParameter Count: 4Parameter Bindings

/// <summary>
/// Test that the JoinedEnumerable works with a single wrapped
/// IEnumerable as expected when fully enumerating the collection.
/// </summary>
[Test]
public void WrapsSingle()
{
   int[] expected = new int[]
                    {
                       1, 2, 3
                    } ;
    [[#variable54b4a420]]first;
    [[#variable54b4a480]]joined = InitSingle( out first);
   int index = 0;
   foreach (int actual in joined)
   {
      Assert.AreEqual(expected[index], actual, "Failure at " + [[#variable54b4a540]]);
      index++;
   }
   Assert.AreEqual(expected.Length, index, "Every expected value was found");
   Assert.IsTrue(first.WasDisposed, "should have been disposed of.");
}

/// <summary>
/// Test that the wrapped IEnumerator has Dispose called even when
/// the JoinedEnumerator doesn't enumerate all the way through the
/// collection.
/// </summary>
[Test]
public void WrapsSingleBreak()
{
   int[] expected = new int[]
                    {
                       1, 2, 3
                    } ;
    [[#variable54b4a420]]first;
    [[#variable54b4a480]]joined = InitSingle( out first);
   foreach (int actual in joined)
   {
      Assert.AreEqual(expected[0], actual, "first one was not what was expected.");
      break;
   }
   // ensure that the first was disposed of even though we didn't enumerate
   // all the way through
   Assert.IsTrue(first.WasDisposed, "should have been disposed of.");
}

/// <summary>
/// Test that the JoinedEnumerable works with multiple wrapped
/// IEnumerable as expected when fully enumerating the collections.
/// </summary>
[Test]
public void WrapsMultiple()
{
   int[] expected = new int[]
                    {
                       1, 2, 3, 4, 5,
                       6
                    } ;
    [[#variable54b4a420]]first;
    [[#variable54b4a420]]second;
    [[#variable54b4a480]]joined = InitMultiple( out first, out second);
   int index = 0;
   foreach (int actual in joined)
   {
      Assert.AreEqual(expected[index], actual, "Failure at " + [[#variable54b4a540]]);
      index++;
   }
   Assert.AreEqual(expected.Length, index, "Every expected value was found");
   Assert.IsTrue(first.WasDisposed, "first should have been disposed of.");
   Assert.IsTrue(second.WasDisposed, "second should have been disposed of. ");
}

/// <summary>
/// Test that the JoinedEnumerable works with multiple wrapped
/// IEnumerable as expected when breaking out.
/// </summary>
[Test]
public void WrapsMultipleBreak()
{
   // break in the first IEnumerator
   WrapsMultipleBreak(2);
   // ensure behavior is consistent if break in 2nd IEnumerator
   WrapsMultipleBreak(4);
}

 [[#variable54b4a2c0]]void WrapsMultipleBreak(int breakIndex)
{
   int[] expected = new int[]
                    {
                       1, 2, 3, 4, 5,
                       6
                    } ;
    [[#variable54b4a420]]first;
    [[#variable54b4a420]]second;
    [[#variable54b4a480]]joined = InitMultiple( out first, out second);
   int index = 0;
   foreach (int actual in joined)
   {
      Assert.AreEqual(expected[index], actual, "Failure at " + [[#variable54b4a540]]);
      index++;
      if (index == breakIndex)
      {
         break;
      }
   }
   Assert.IsTrue(first.WasDisposed, "first should have been disposed of.");
   Assert.IsTrue(second.WasDisposed, "second should have been disposed of. ");
}

 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#54b4a420]]
EnumerableTester<int> 
12[[#54b4a420]]
EnumerableTester 
21[[#54b4a480]]
JoinedEnumerable<int> 
22[[#54b4a480]]
JoinedEnumerable 
31[[#54b4a540]]
index 
32[[#54b4a540]]
index.ToString() 
41[[#54b4a2c0]]
private static 
42[[#54b4a2c0]]
private