public void ContainsTest() { ListMapping<string, int> TestObject = new ListMapping<string, int>(); TestObject.Add("A", 0); TestObject.Add("A", 1); Assert.True(TestObject.Contains("A", 0)); Assert.False(TestObject.Contains("A", 2)); }
public void RemoveTest() { ListMapping<string, int> TestObject = new ListMapping<string, int>(); TestObject.Add("A", 0); TestObject.Add("A", 1); TestObject.Remove("A", 0); Assert.Equal(1, TestObject["A"].Count); Assert.Equal(1, TestObject["A"].FirstOrDefault()); }
public void ContainsTest() { ListMapping <string, int> TestObject = new ListMapping <string, int>(); TestObject.Add("A", 0); TestObject.Add("A", 1); Assert.True(TestObject.Contains("A", 0)); Assert.False(TestObject.Contains("A", 2)); }
public void RemoveTest() { ListMapping <string, int> TestObject = new ListMapping <string, int>(); TestObject.Add("A", 0); TestObject.Add("A", 1); TestObject.Remove("A", 0); Assert.Equal(1, TestObject["A"].Count); Assert.Equal(1, TestObject["A"][0]); }
public void RemoveTest() { var TestObject = new ListMapping <string, int>(); TestObject.Add("A", 0); TestObject.Add("A", 1); TestObject.Remove("A", 0); Assert.Equal(1, TestObject["A"].Count()); Assert.Equal(1, TestObject["A"].FirstOrDefault()); }
public void RandomTest() { ListMapping<string, int> TestObject = new ListMapping<string, int>(); Utilities.Random.Random Rand = new Utilities.Random.Random(); for (int x = 0; x < 10; ++x) { string Name = Rand.Next<string>(new RegexStringGenerator(10)); for (int y = 0; y < 5; ++y) { int Value=Rand.Next(); TestObject.Add(Name, Value); Assert.Equal(y + 1, TestObject[Name].Count); Assert.Equal(Value, TestObject[Name].ElementAt(y)); } } Assert.Equal(10, TestObject.Count); }
public void RandomTest() { var TestObject = new ListMapping<string, int>(); var Rand = new System.Random(); for (int x = 0; x < 10; ++x) { var Name = x.ToString(); for (int y = 0; y < 5; ++y) { var Value = Rand.Next(); TestObject.Add(Name, Value); Assert.Equal(y + 1, TestObject[Name].Count()); Assert.True(TestObject[Name].Contains(Value)); } } Assert.Equal(10, TestObject.Count); }
public void RandomTest() { ListMapping <string, int> TestObject = new ListMapping <string, int>(); Utilities.Random.Random Rand = new Utilities.Random.Random(); for (int x = 0; x < 10; ++x) { string Name = Rand.NextString(10); for (int y = 0; y < 5; ++y) { int Value = Rand.Next(); TestObject.Add(Name, Value); Assert.Equal(y + 1, TestObject[Name].Count); Assert.Equal(Value, TestObject[Name][y]); } } Assert.Equal(10, TestObject.Count); }
public void RandomTest() { var TestObject = new ListMapping <string, int>(); var Rand = new System.Random(); for (int x = 0; x < 10; ++x) { var Name = x.ToString(); for (int y = 0; y < 5; ++y) { var Value = Rand.Next(); TestObject.Add(Name, Value); Assert.Equal(y + 1, TestObject[Name].Count()); Assert.True(TestObject[Name].Contains(Value)); } } Assert.Equal(10, TestObject.Count); }