public void TestNormalInputThreeNames() { NameSorter.NameSorter.Person test2 = new NameSorter.NameSorter.Person("Claire Sally Brown"); Assert.Equal("Claire Sally", test2.FirstName); Assert.Equal("Brown", test2.LastName); Assert.Equal("Claire Sally Brown", test2.ToString()); }
public void TestNormalInputTwoNames() { NameSorter.NameSorter.Person test1 = new NameSorter.NameSorter.Person("Abby Johnson"); Assert.Equal("Abby", test1.FirstName); Assert.Equal("Johnson", test1.LastName); Assert.Equal("Abby Johnson", test1.ToString()); }
public void TestAbnormalInputEmpyString() { Action emptyStringTest = () => { NameSorter.NameSorter.Person test = new NameSorter.NameSorter.Person(""); }; var ex = Assert.Throws <ArgumentException>(emptyStringTest); Assert.NotNull(ex); //Commented out below is another attempt at making the test work! /** * Exception ex = Assert.Throws<ArgumentException>(() => new NameSorter.NameSorter.Person("")); * Assert.Equal("Must have at least first and last name", ex.Message); */ }