CloneSet40


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
49230.951class_member_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
149356
src/Iesi.Collections.Test/Generic/SetFixture.cs
249288
src/Iesi.Collections.Test/SetFixture.cs
Clone Instance
1
Line Count
49
Source Line
356
Source File
src/Iesi.Collections.Test/Generic/SetFixture.cs

                [Test]
                public void Union()
                {
                        ISet<string> a = CreateInstance(_aInitValues);
                        ISet<string> b = CreateInstance(_bInitValues);

                        ISet<string> ab = Set<string>.Union(a, b);

                        Assert.AreEqual(5, ab.Count, "contains 5 elements - 'zero' through 'four'");
                        Assert.IsTrue(ab.Contains("zero"), "should contain 'zero'");
                        Assert.IsTrue(ab.Contains("one"), "should contain 'one'");
                        Assert.IsTrue(ab.Contains("two"), "should contain 'two'");
                        Assert.IsTrue(ab.Contains("three"), "should contain 'three'");
                        Assert.IsTrue(ab.Contains("four"), "should contain 'four'");

                        Assert.IsTrue(a.ContainsAll(_aInitValues), "should not have modified a");
                        Assert.IsTrue(b.ContainsAll(_bInitValues), "should not have modified b");

                        ISet<string> aNull = Set<string>.Union(a, null);
                        Assert.AreEqual(_aInitValues.Count, aNull.Count, "count not changed");
                        Assert.IsTrue(aNull.ContainsAll(_aInitValues), "still contains all initial values");

                        ISet<string> bNull = Set<string>.Union(null, b);
                        Assert.AreEqual(_bInitValues.Count, bNull.Count, "count not changed");
                        Assert.IsTrue(bNull.ContainsAll(_bInitValues), "still contains all initial values");

                        ISet<string> bothNull = Set<string>.Union(null, null);
                        Assert.AreEqual(null, bothNull, "two nulls intersect as null");
                }

                #endregion

                #region Iesi.Collection.ISet<string> Operator Tests

                [Test]
                public void ExclusiveOrOperator()
                {
                        ISet<string> a = CreateInstance(_aInitValues);
                        ISet<string> b = CreateInstance(_bInitValues);

                        ISet<string> ab = (Set<string> )a ^ (Set<string> )b;

                        Assert.AreEqual(3, ab.Count, "contains 3 elements - 'zero', 'one', and 'four'");
                        Assert.IsTrue(ab.Contains("zero"), "should contain 'zero'");
                        Assert.IsTrue(ab.Contains("one"), "should contain 'one'");
                        Assert.IsTrue(ab.Contains("four"), "should contain 'four'");

                        Assert.IsTrue(a.ContainsAll(_aInitValues), "should not have modified a");
                        Assert.IsTrue(b.ContainsAll(_bInitValues), "should not have modified b");
                }



Clone Instance
2
Line Count
49
Source Line
288
Source File
src/Iesi.Collections.Test/SetFixture.cs

                [Test]
                public void Union()
                {
                        ISet a = CreateInstance(_aInitValues);
                        ISet b = CreateInstance(_bInitValues);

                        ISet ab = Set.Union(a, b);

                        Assert.AreEqual(5, ab.Count, "contains 5 elements - 'zero' through 'four'");
                        Assert.IsTrue(ab.Contains("zero"), "should contain 'zero'");
                        Assert.IsTrue(ab.Contains("one"), "should contain 'one'");
                        Assert.IsTrue(ab.Contains("two"), "should contain 'two'");
                        Assert.IsTrue(ab.Contains("three"), "should contain 'three'");
                        Assert.IsTrue(ab.Contains("four"), "should contain 'four'");

                        Assert.IsTrue(a.ContainsAll(_aInitValues), "should not have modified a");
                        Assert.IsTrue(b.ContainsAll(_bInitValues), "should not have modified b");

                        ISet aNull = Set.Union(a, null);
                        Assert.AreEqual(_aInitValues.Count, aNull.Count, "count not changed");
                        Assert.IsTrue(aNull.ContainsAll(_aInitValues), "still contains all initial values");

                        ISet bNull = Set.Union(null, b);
                        Assert.AreEqual(_bInitValues.Count, bNull.Count, "count not changed");
                        Assert.IsTrue(bNull.ContainsAll(_bInitValues), "still contains all initial values");

                        ISet bothNull = Set.Union(null, null);
                        Assert.AreEqual(null, bothNull, "two nulls intersect as null");
                }

                #endregion

                #region Iesi.Collection.ISet Operator Tests

                [Test]
                public void ExclusiveOrOperator()
                {
                        ISet a = CreateInstance(_aInitValues);
                        ISet b = CreateInstance(_bInitValues);

                        ISet ab = (Set) a ^ (Set) b;

                        Assert.AreEqual(3, ab.Count, "contains 3 elements - 'zero', 'one', and 'four'");
                        Assert.IsTrue(ab.Contains("zero"), "should contain 'zero'");
                        Assert.IsTrue(ab.Contains("one"), "should contain 'one'");
                        Assert.IsTrue(ab.Contains("four"), "should contain 'four'");

                        Assert.IsTrue(a.ContainsAll(_aInitValues), "should not have modified a");
                        Assert.IsTrue(b.ContainsAll(_bInitValues), "should not have modified b");
                }



Clone AbstractionParameter Count: 3Parameter Bindings

[Test]
public void Union()
{
    [[#variable6ff5a220]]a = CreateInstance(_aInitValues);
    [[#variable6ff5a220]]b = CreateInstance(_bInitValues);
    [[#variable6ff5a220]]ab = [[#variable57d0d980]].Union(a, b);
   Assert.AreEqual(5, ab.Count, "contains 5 elements - 'zero' through 'four'");
   Assert.IsTrue(ab.Contains("zero"), "should contain 'zero'");
   Assert.IsTrue(ab.Contains("one"), "should contain 'one'");
   Assert.IsTrue(ab.Contains("two"), "should contain 'two'");
   Assert.IsTrue(ab.Contains("three"), "should contain 'three'");
   Assert.IsTrue(ab.Contains("four"), "should contain 'four'");
   Assert.IsTrue(a.ContainsAll(_aInitValues), "should not have modified a");
   Assert.IsTrue(b.ContainsAll(_bInitValues), "should not have modified b");
    [[#variable6ff5a220]]aNull = [[#variable57d0d980]].Union(a, null);
   Assert.AreEqual(_aInitValues.Count, aNull.Count, "count not changed");
   Assert.IsTrue(aNull.ContainsAll(_aInitValues), "still contains all initial values");
    [[#variable6ff5a220]]bNull = [[#variable57d0d980]].Union(null, b);
   Assert.AreEqual(_bInitValues.Count, bNull.Count, "count not changed");
   Assert.IsTrue(bNull.ContainsAll(_bInitValues), "still contains all initial values");
    [[#variable6ff5a220]]bothNull = [[#variable57d0d980]].Union(null, null);
   Assert.AreEqual(null, bothNull, "two nulls intersect as null");
}

#endregion
#region Iesi.Collection.ISet<string> Operator Tests
#region Iesi.Collection.ISet Operator Tests
[Test]
public void ExclusiveOrOperator()
{
    [[#variable6ff5a220]]a = CreateInstance(_aInitValues);
    [[#variable6ff5a220]]b = CreateInstance(_bInitValues);
    [[#variable6ff5a220]]ab = ( [[#variable6fd22320]])a ^ ( [[#variable6fd22320]])b;
   Assert.AreEqual(3, ab.Count, "contains 3 elements - 'zero', 'one', and 'four'");
   Assert.IsTrue(ab.Contains("zero"), "should contain 'zero'");
   Assert.IsTrue(ab.Contains("one"), "should contain 'one'");
   Assert.IsTrue(ab.Contains("four"), "should contain 'four'");
   Assert.IsTrue(a.ContainsAll(_aInitValues), "should not have modified a");
   Assert.IsTrue(b.ContainsAll(_bInitValues), "should not have modified b");
}

 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#6ff5a220]]
ISet<string> 
12[[#6ff5a220]]
ISet 
21[[#57d0d980]]
Set<string> 
22[[#57d0d980]]
Set 
31[[#6fd22320]]
Set<string> 
32[[#6fd22320]]
Set