public void CharRoundTripTest() { var generator = new Generator("CharRoundTripTest"); var clone = generator.Clone(); for (int t = 0; t < 100; t++) { var f = MixingFunctions.CreateCharMixer(generator); var g = MixingFunctions.CreateCharInverseMixer(clone); for (int i = 0; i < 256; i++) { Assert.AreEqual((Char)i, g(f((Char)i))); Assert.AreEqual((Char)i, f(g((Char)i))); } } }
public void CharTest() { var generator = new Generator("CharTest"); for (int t = 0; t < 100; t++) { var fn = MixingFunctions.CreateCharMixer(generator); var used = new HashSet <Char>(); for (int i = 0; i < 256; i++) { used.Add(fn((Char)i)); } Assert.AreEqual(256, used.Count); } }