Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
49 | 2 | 3 | 0.951 | class_member_declarations[2] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 49 | 356 | src/Iesi.Collections.Test/Generic/SetFixture.cs |
2 | 49 | 288 | src/Iesi.Collections.Test/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"); } |
| ||||
[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"); } |
| |||
[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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#6ff5a220]] | ISet<string> |
1 | 2 | [[#6ff5a220]] | ISet |
2 | 1 | [[#57d0d980]] | Set<string> |
2 | 2 | [[#57d0d980]] | Set |
3 | 1 | [[#6fd22320]] | Set<string> |
3 | 2 | [[#6fd22320]] | Set |