public void CheckForBlankMethods_Should_ReturnTheExpectedListOfUnityTestBDDErrorObjects_Given_AChosenMethodsListWithoutEmptyElements() { string[] chosenMethods = new string[5] { "class.method", "class.method", "class.method", "class.method", "class.method" }; ChosenMethodsChecker checkForErrors = new ChosenMethodsChecker(); List <UnityTestBDDError> result = checkForErrors.CheckForBlankMethods <GivenBaseAttribute>(chosenMethods); Assert.AreEqual(0, result.Count, "The method CheckForBlankMethods doesn't check properly"); }
public void CheckForBlankMethods_Should_ReturnTheExpectedListOfUnityTestBDDErrorObjects_Given_AChosenMethodsListWithAnEmptyElement() { string[] chosenMethods = new string[5] { "class.method", "class.method", string.Empty, "class.method", "class.method" }; ChosenMethodsChecker checkForErrors = new ChosenMethodsChecker(); List <UnityTestBDDError> result = checkForErrors.CheckForBlankMethods <GivenBaseAttribute>(chosenMethods); Assert.AreEqual(1, result.Count, "The method CheckForBlankMethods doesn't check properly"); string expectedMessage = "Incomplete settings detected on Given methods at position 3"; Assert.AreEqual(expectedMessage, result[0].Message, "The method CheckForBlankMethods doesn't resturn the right message"); Assert.IsNull(result[0].Component, "The method CheckForBlankMethods doesn't resturn the right Component"); Assert.IsNull(result[0].MethodMethodInfo, "The method CheckForBlankMethods doesn't resturn the right MethodInfo"); Assert.AreEqual(typeof(GivenBaseAttribute), result[0].StepType, "The method CheckForBlankMethods doesn't resturn the right StepType"); Assert.AreEqual(2, result[0].Index, "The method CheckForBlankMethods doesn't resturn the right method index"); }