Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
46 | 2 | 4 | 0.954 | class_member_declarations[3] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 46 | 185 | src/Iesi.Collections.Test/Generic/SetFixture.cs |
2 | 46 | 147 | src/Iesi.Collections.Test/SetFixture.cs |
| ||||
[Test] public void Contains() { Assert.IsTrue(_set.Contains(one), "does contain one"); Assert.IsFalse(_set.Contains("four"), "does not contain 'four'"); } [Test] public void ContainsAll() { List<string> all = new List<string> (2); all.Add("one"); all.Add("two"); Assert.IsTrue(_set.ContainsAll(all), "should contain 'one' and 'two'"); all.Add("not in there"); Assert.IsFalse(_set.ContainsAll(all), "should not contain the just added 'not in there'"); } [Test] public void ExclusiveOr() { ISet<string> a = CreateInstance(_aInitValues); ISet<string> b = CreateInstance(_bInitValues); ISet<string> ab = Set<string>.ExclusiveOr(a, 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"); ISet<string> aNull = Set<string>.ExclusiveOr(a, null); Assert.AreEqual(_aInitValues.Count, aNull.Count, "count still same"); Assert.IsTrue(aNull.ContainsAll(_aInitValues), "all A elements kept"); ISet<string> bNull = Set<string>.ExclusiveOr(null, b); Assert.AreEqual(_bInitValues.Count, bNull.Count, "count still same"); Assert.IsTrue(bNull.ContainsAll(_bInitValues), "all B elements kept"); ISet<string> bothNull = Set<string>.ExclusiveOr(null, null); Assert.AreEqual(null, bothNull, "two null sets return null set"); } |
| ||||
[Test] public void Contains() { Assert.IsTrue(_set.Contains(one), "does contain one"); Assert.IsFalse(_set.Contains("four"), "does not contain 'four'"); } [Test] public void ContainsAll() { ArrayList all = new ArrayList(2); all.Add("one"); all.Add("two"); Assert.IsTrue(_set.ContainsAll(all), "should contain 'one' and 'two'"); all.Add("not in there"); Assert.IsFalse(_set.ContainsAll(all), "should not contain the just added 'not in there'"); } [Test] public void ExclusiveOr() { ISet a = CreateInstance(_aInitValues); ISet b = CreateInstance(_bInitValues); ISet ab = Set.ExclusiveOr(a, 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"); ISet aNull = Set.ExclusiveOr(a, null); Assert.AreEqual(_aInitValues.Count, aNull.Count, "count still same"); Assert.IsTrue(aNull.ContainsAll(_aInitValues), "all A elements kept"); ISet bNull = Set.ExclusiveOr(null, b); Assert.AreEqual(_bInitValues.Count, bNull.Count, "count still same"); Assert.IsTrue(bNull.ContainsAll(_bInitValues), "all B elements kept"); ISet bothNull = Set.ExclusiveOr(null, null); Assert.AreEqual(null, bothNull, "two null sets return null set"); } |
| |||
[Test] public void Contains() { Assert.IsTrue(_set.Contains(one), "does contain one"); Assert.IsFalse(_set.Contains("four"), "does not contain 'four'"); } [Test] public void ContainsAll() { [[#variable6f2006c0]]all = new [[#variable6e584660]](2); all.Add("one"); all.Add("two"); Assert.IsTrue(_set.ContainsAll(all), "should contain 'one' and 'two'"); all.Add("not in there"); Assert.IsFalse(_set.ContainsAll(all), "should not contain the just added 'not in there'"); } [Test] public void ExclusiveOr() { [[#variable6f523d40]]a = CreateInstance(_aInitValues); [[#variable6f523d40]]b = CreateInstance(_bInitValues); [[#variable6f523d40]]ab = [[#variable6f200620]].ExclusiveOr(a, 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"); [[#variable6f523d40]]aNull = [[#variable6f200620]].ExclusiveOr(a, null); Assert.AreEqual(_aInitValues.Count, aNull.Count, "count still same"); Assert.IsTrue(aNull.ContainsAll(_aInitValues), "all A elements kept"); [[#variable6f523d40]]bNull = [[#variable6f200620]].ExclusiveOr(null, b); Assert.AreEqual(_bInitValues.Count, bNull.Count, "count still same"); Assert.IsTrue(bNull.ContainsAll(_bInitValues), "all B elements kept"); [[#variable6f523d40]]bothNull = [[#variable6f200620]].ExclusiveOr(null, null); Assert.AreEqual(null, bothNull, "two null sets return null set"); } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#6f2006c0]] | List<string> |
1 | 2 | [[#6f2006c0]] | ArrayList |
2 | 1 | [[#6e584660]] | List<string> |
2 | 2 | [[#6e584660]] | ArrayList |
3 | 1 | [[#6f523d40]] | ISet<string> |
3 | 2 | [[#6f523d40]] | ISet |
4 | 1 | [[#6f200620]] | Set<string> |
4 | 2 | [[#6f200620]] | Set |