public void InvertTest() { var setA = new UniqueIdentificationSet(false).With(set => set.__Assign(new LinkedList <UniqueIdentificationSet.Segment>().With(x => { x.AddLast(new UniqueIdentificationSet.Segment { low = 0, high = 5 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 10, high = 16 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 18, high = 22 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 25, high = 100 }); }))); var setB = new UniqueIdentificationSet(false).With(set => set.__Assign(new LinkedList <UniqueIdentificationSet.Segment>().With(x => { x.AddLast(new UniqueIdentificationSet.Segment { low = 1, high = 5 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 10, high = 16 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 18, high = 22 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 25, high = 100 }); }))); var setC = new UniqueIdentificationSet(false).With(set => set.__Assign(new LinkedList <UniqueIdentificationSet.Segment>().With(x => { x.AddLast(new UniqueIdentificationSet.Segment { low = 1, high = 5 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 10, high = 16 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 18, high = 22 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 25, high = uint.MaxValue }); }))); var setD = new UniqueIdentificationSet(false).With(set => set.__Assign(new LinkedList <UniqueIdentificationSet.Segment>().With(x => { x.AddLast(new UniqueIdentificationSet.Segment { low = 0, high = 5 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 10, high = 16 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 18, high = 22 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 25, high = uint.MaxValue }); }))); AssertEquals("[6, 9][17, 17][23, 24][101, " + UInt32.MaxValue + "]", setA.Invert().ToString()); AssertEquals("[0, 0][6, 9][17, 17][23, 24][101, " + UInt32.MaxValue + "]", setB.Invert().ToString()); AssertEquals("[0, 0][6, 9][17, 17][23, 24]", setC.Invert().ToString()); AssertEquals("[6, 9][17, 17][23, 24]", setD.Invert().ToString()); }
public void InvertTest() { var setA = new UniqueIdentificationSet(false).With(set => set.__Assign(new LinkedList<UniqueIdentificationSet.Segment>().With(x => { x.AddLast(new UniqueIdentificationSet.Segment { low = 0, high = 5 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 10, high = 16 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 18, high = 22 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 25, high = 100 }); }))); var setB = new UniqueIdentificationSet(false).With(set => set.__Assign(new LinkedList<UniqueIdentificationSet.Segment>().With(x => { x.AddLast(new UniqueIdentificationSet.Segment { low = 1, high = 5 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 10, high = 16 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 18, high = 22 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 25, high = 100 }); }))); var setC = new UniqueIdentificationSet(false).With(set => set.__Assign(new LinkedList<UniqueIdentificationSet.Segment>().With(x => { x.AddLast(new UniqueIdentificationSet.Segment { low = 1, high = 5 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 10, high = 16 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 18, high = 22 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 25, high = uint.MaxValue }); }))); var setD = new UniqueIdentificationSet(false).With(set => set.__Assign(new LinkedList<UniqueIdentificationSet.Segment>().With(x => { x.AddLast(new UniqueIdentificationSet.Segment { low = 0, high = 5 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 10, high = 16 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 18, high = 22 }); x.AddLast(new UniqueIdentificationSet.Segment { low = 25, high = uint.MaxValue }); }))); AssertEquals("[6, 9][17, 17][23, 24][101, " + UInt32.MaxValue + "]", setA.Invert().ToString()); AssertEquals("[0, 0][6, 9][17, 17][23, 24][101, " + UInt32.MaxValue + "]", setB.Invert().ToString()); AssertEquals("[0, 0][6, 9][17, 17][23, 24]", setC.Invert().ToString()); AssertEquals("[6, 9][17, 17][23, 24]", setD.Invert().ToString()); }