public void Add_Ints_IncreaseCount() { // Arrange ListProperties <int> list = new ListProperties <int>(); // Act list.Add(1); list.Add(2); list.Add(3); int result = 3; // Assert Assert.AreEqual(result, list.Count); }
public void Remove_SingleObject_CountGoesDown() { // Arrange ListProperties <object> list = new ListProperties <object>(); list.Add(list); list.Add(list); // Act int expected = 1; list.Remove(list); // Assert Assert.AreEqual(expected, list.Count); }
public void Remove_Object_ResultEqualsTrue() { // Arrange ListProperties <object> list = new ListProperties <object>(); list.Add(list); list.Add(list); // Act bool expected = true; bool remove = list.Remove(list); // Assert Assert.AreEqual(expected, remove); }
public void Remove_Objects_ThrowException() { // Arrange ListProperties <object> list = new ListProperties <object>(); object notExpected = list; // Act list.Add(list); list.Add(list); list.Add(list); list.Remove(list); list.Remove(list); list.Remove(list); // Assert Assert.AreNotEqual(notExpected, list[0]); }
public void Remove_SingleInt_CountGoesDown() { // Arrange ListProperties <int> list = new ListProperties <int>(); list.Add(1); list.Add(1); list.Add(1); list.Add(1); // Act int notExpected = list.Count; list.Remove(1); // Assert Assert.AreNotEqual(notExpected, list.Count); }
public void Add_MultiInts_ImprovedArray() { // Arrange ListProperties <int> list = new ListProperties <int>(); ListProperties <int> expected = new ListProperties <int>() { 1, 2, 3 }; // Act list.Add(1); list.Add(2); list.Add(3); Assert.AreEqual(list[0], expected[0]); }
public void Add_MultiStrings_ImprovedArray() { // Arrange ListProperties <string> list = new ListProperties <string>(); ListProperties <string> expected = new ListProperties <string>() { "One", "Two", "Three" }; // Act list.Add("One"); list.Add("Two"); list.Add("Three"); // Assert Assert.AreEqual(expected[0], list[0]); }
public void Add_SingleInt_ArrayLoads() { // Arrange ListProperties <int> list = new ListProperties <int>(); // Act list.Add(1); int expected = 1; // Assert Assert.AreEqual(expected, list[0]); }
public void ZipListProperties_ListPropertiesobject_ListPropertiesZipped() { //Arrange ListProperties <Objects> objectsA = new ListProperties <Objects>(); ListProperties <Objects> objectsB = new ListProperties <Objects>(); ListProperties <Objects> actualResult = new ListProperties <Objects>(); Objects ObjectA = new Objects(); Objects ObjectB = new Objects(); objectsA.Add(ObjectA); objectsB.Add(ObjectB); ListProperties <Objects> expectedResult = new ListProperties <Objects>(); expectedResult.Add(ObjectA); expectedResult.Add(ObjectB); //Act actualResult = objectsA.Zip(objectsB); //Assert Assert.AreEqual(expectedResult.ToString(), actualResult.ToString()); }
public void ZipListProperties_ListPropertiesint_ListPropertiesZipped() { //Arrange ListProperties <int> expectedResult = new ListProperties <int>() { 1, 2, 3, 4 }; ListProperties <int> numbers = new ListProperties <int>(); ListProperties <int> moreNumbers = new ListProperties <int>(); ListProperties <int> actualResult = new ListProperties <int>(); numbers.Add(1); numbers.Add(3); moreNumbers.Add(2); moreNumbers.Add(4); //Act actualResult = numbers.Zip(moreNumbers); //Assert Assert.AreEqual(expectedResult.ToString(), actualResult.ToString()); }
public void Remove_EveryInts_ThrowException() { // Arrange ListProperties <int> list = new ListProperties <int>(); list.Add(1); int notExpected = 1; // Act list.Remove(1); // Assert Assert.AreNotEqual(notExpected, list[0]); }
public void Add_SingleInt_IncreaseCount() { // Arrange ListProperties <int> list = new ListProperties <int>(); ListProperties <int> expected = new ListProperties <int>() { 1 }; // Act list.Add(1); // Assert Assert.AreEqual(expected.Count, list.Count); }
public void Add_Objects_ImproveArray() { // Arrange ListProperties <object> list = new ListProperties <object>(); ListProperties <object> expected = new ListProperties <object>() { 1 }; // Act list.Add(1); int[] result = new int[] { 1 }; // Assert Assert.AreEqual(expected.Count, list.Count); }
public void ZipListProperties_ListPropertiesString_ListPropertiesZipped() { //Arrange ListProperties <string> expectedResult = new ListProperties <string>(); expectedResult.Add("A"); expectedResult.Add("B"); expectedResult.Add("C"); expectedResult.Add("D"); ListProperties <string> stringsA = new ListProperties <string>(); ListProperties <string> stringsB = new ListProperties <string>(); ListProperties <string> actualResult = new ListProperties <string>(); stringsA.Add("A"); stringsA.Add("C"); stringsB.Add("B"); stringsB.Add("D"); //Act actualResult = stringsA.Zip(stringsB); //Assert Assert.AreEqual(expectedResult.ToString(), actualResult.ToString()); }
public void Minus_Objects_CountDecreases() { // Arrange ListProperties <object> list = new ListProperties <object>() { }; list.Add(list); // Act int expected = 0; list = list - list; // Assert Assert.AreEqual(expected, list.Count); }
public void Add_MultiObjects_SizeExpands() { // Arrange ListProperties <object> list = new ListProperties <object>(); // Act object obj = new object(); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); list.Add(obj); int expected = 19; // Assert Assert.AreEqual(expected, list.Count); }