public void SequenceGeneratorSByte__Should_work() { var generator = new SequenceGeneratorSByte(); Assert.Equal((SByte)0, generator.GetValue()); Assert.Equal((SByte)1, generator.GetValue()); Assert.Equal((SByte)2, generator.GetValue()); generator = new SequenceGeneratorSByte { From = 3 }; Assert.Equal((SByte)3, generator.GetValue()); Assert.Equal((SByte)4, generator.GetValue()); Assert.Equal((SByte)5, generator.GetValue()); generator = new SequenceGeneratorSByte { From = 3, Step = 3 }; Assert.Equal((SByte)3, generator.GetValue()); Assert.Equal((SByte)6, generator.GetValue()); Assert.Equal((SByte)9, generator.GetValue()); generator = new SequenceGeneratorSByte { From = 3, Step = -3 }; Assert.Equal((SByte)3, generator.GetValue()); Assert.Equal((SByte)0, generator.GetValue()); Assert.Equal((SByte)(-3), generator.GetValue()); generator = new SequenceGeneratorSByte { From = SByte.MaxValue - 1 }; Assert.Equal((SByte)(SByte.MaxValue - 1), generator.GetValue()); Assert.Equal((SByte)(SByte.MaxValue - 0), generator.GetValue()); Assert.Equal((SByte)(SByte.MinValue + 0), generator.GetValue()); Assert.Equal((SByte)(SByte.MinValue + 1), generator.GetValue()); }
public void SequenceGeneratorSByte__Should_work() { var generator = new SequenceGeneratorSByte(); Assert.AreEqual((SByte)0, generator.GetValue()); Assert.AreEqual((SByte)1, generator.GetValue()); Assert.AreEqual((SByte)2, generator.GetValue()); generator = new SequenceGeneratorSByte { From = 3 }; Assert.AreEqual((SByte)3, generator.GetValue()); Assert.AreEqual((SByte)4, generator.GetValue()); Assert.AreEqual((SByte)5, generator.GetValue()); generator = new SequenceGeneratorSByte { From = 3, Step = 3 }; Assert.AreEqual((SByte)3, generator.GetValue()); Assert.AreEqual((SByte)6, generator.GetValue()); Assert.AreEqual((SByte)9, generator.GetValue()); generator = new SequenceGeneratorSByte { From = 3, Step = -3 }; Assert.AreEqual((SByte)3, generator.GetValue()); Assert.AreEqual((SByte)0, generator.GetValue()); Assert.AreEqual((SByte)(-3), generator.GetValue()); generator = new SequenceGeneratorSByte { From = SByte.MaxValue - 1 }; Assert.AreEqual((SByte)(SByte.MaxValue - 1), generator.GetValue()); Assert.AreEqual((SByte)(SByte.MaxValue - 0), generator.GetValue()); Assert.AreEqual((SByte)(SByte.MinValue + 0), generator.GetValue()); Assert.AreEqual((SByte)(SByte.MinValue + 1), generator.GetValue()); }