Пример #1
0
        public void Count_AllRecordsDeleted_0()
        {
            //Assemble
            int         expected    = 0;
            ClientTable clientTable = new ClientTable();

            //Act
            int actual = clientTable.count();

            //Assert
            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void Delete_NonExistantId_0()
        {
            //Assemble
            ClientTable clientTable = new ClientTable();
            int         expected    = 0;

            //Act
            clientTable.delete(0);
            int actual = clientTable.count();

            //Assert
            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void Count_Created1Record_1()
        {
            //Assemble
            ClientModel clientModel = new ClientModel();

            clientModel.name  = "Bob";
            clientModel.phone = "07561 101169";
            clientModel.email = "*****@*****.**";
            int         expected    = 1;
            ClientTable clientTable = new ClientTable();

            //Act
            int clientID = clientTable.create(clientModel);
            int actual   = clientTable.count();

            //Assert
            Assert.AreEqual(expected, actual);
        }
Пример #4
0
        public void Delete_CreatedDeleteAndCount1Record_0()
        {
            //Assemble
            ClientModel clientModel = new ClientModel();

            clientModel.displayName = "Barry Bonds";
            clientModel.phone       = "07561 101169";
            clientModel.email       = "*****@*****.**";
            int         expected    = 0;
            ClientTable clientTable = new ClientTable();
            int         clientID    = clientTable.create(clientModel);

            //Act
            clientTable.delete(clientID);
            int actual = clientTable.count();

            //Assert
            Assert.AreEqual(expected, actual);
        }