Пример #1
0
        public void AddName_NullString_NoNameAddedToList()
        {
            // Arrange
            INameList nameList = new NameList();
            string    testName = null;

            // Act
            nameList.AddName(testName);

            // Assert
            Assert.IsTrue(nameList.GetAllNames().Length == 0);
        }
Пример #2
0
        public void AddName_TwoWordString_NameAddedToList()
        {
            // Arrange
            INameList nameList = new NameList();
            string    testName = "Joseba Kruse";

            // Act
            nameList.AddName(testName);

            // Assert
            Assert.IsTrue(nameList.GetName(testName).givenNames == "Joseba");
            Assert.IsTrue(nameList.GetName(testName).surname == "Kruse");
        }
Пример #3
0
        public void AddName_ThreeWordString_NameAddedToList()
        {
            // Arrange
            INameList nameList = new NameList();
            string    testName = "Pyrrhos Jakov Wang";

            // Act
            nameList.AddName(testName);

            // Assert
            Assert.IsTrue(nameList.GetName(testName).givenNames == "Pyrrhos Jakov");
            Assert.IsTrue(nameList.GetName(testName).surname == "Wang");
        }
Пример #4
0
        public void AddName_OneWordString_NameAddedToList()
        {
            // Arrange
            INameList nameList = new NameList();
            string    testName = "Muirgen";

            // Act
            nameList.AddName(testName);

            // Assert
            Assert.IsTrue(nameList.GetName(testName).givenNames == "");
            Assert.IsTrue(nameList.GetName(testName).surname == "Muirgen");
        }