public void MinusOperator_SubstractingSecondListHasMoreItems_ShouldReturnSubstractedList() { // arrange CustomClassList <int> test1 = new CustomClassList <int>(); CustomClassList <int> test2 = new CustomClassList <int>(); CustomClassList <int> expected1 = new CustomClassList <int>(); CustomClassList <int> actual1 = new CustomClassList <int>(); test1.Add(0); test1.Add(1); test1.Add(2); test2.Add(1); test2.Add(3); test2.Add(4); test2.Add(5); expected1.Add(0); expected1.Add(2); string expected = expected1.ToString(); // act actual1 = test1 - test2; string actual = actual1.ToString(); // assert Assert.AreEqual(expected, actual); }
public void ToString_AListOfBooleans_ReturnFirstBoolPlusSecond() { // arrange CustomClassList <bool> test = new CustomClassList <bool>(); test.Add(true); test.Add(false); test.Add(true); string actual; // act actual = test.ToString(); // assert actual.Should().Be("TrueFalseTrue"); }
public void ToString_ApplyTOAListOfIntegers_ShouldReturnString() { // arrange CustomClassList <int> test = new CustomClassList <int>(); test.Add(0); test.Add(1); test.Add(2); test.Add(3); string actual; // act actual = test.ToString(); // assert actual.Should().Be("0123"); }
public void ToString_ApplyToAListOfIntegers_CountDoesntChange() { // arrange CustomClassList <int> test = new CustomClassList <int>(); test.Add(0); test.Add(1); test.Add(2); test.Add(3); int expected = 4; int actual; // act test.ToString(); actual = test.Count; // assert Assert.AreEqual(expected, actual); }
public void ToString_ApplyToAListOfIntegers_TurnsEachNumberToString() { // arrange CustomClassList <int> test = new CustomClassList <int>(); test.Add(0); test.Add(1); test.Add(2); test.Add(3); char expected = '1'; string returnedString; char actual; // act returnedString = test.ToString(); actual = returnedString[1]; // assert Assert.AreEqual(expected, actual); }
public void MinusOperator_SubstractingTwoLists_ResultListShouldNotIncludeAnyItemsFromSecondList() { // arrange CustomClassList <int> test1 = new CustomClassList <int>(); CustomClassList <int> test2 = new CustomClassList <int>(); CustomClassList <int> expected1 = new CustomClassList <int>(); CustomClassList <int> actual1 = new CustomClassList <int>(); test1.Add(0); test1.Add(1); test1.Add(2); test2.Add(1); test2.Add(2); test2.Add(5); expected1.Add(0); string expected = expected1.ToString(); // act actual1 = test1 - test2; string actual = actual1.ToString(); // assert Assert.AreEqual(expected, actual); }