예제 #1
0
        public void TestGetDeactivatedChildById()
        {
            // Arrange
            ChildSqlDAO dao = new ChildSqlDAO(this.connectionString);

            // Act
            Child child = dao.GetDeactivatedChildById(johnny, ruth);

            //Assert
            Assert.AreEqual("Johnny", child.FirstName);
        }
예제 #2
0
        public void TestGetChildById()
        {
            // Arrange
            ChildSqlDAO dao = new ChildSqlDAO(this.connectionString);

            // Act
            Child child = dao.GetChildById(ellie, ruth);

            //Assert
            Assert.AreEqual("Ellie", child.FirstName);
        }
예제 #3
0
        public void TestReinstateChild()
        {
            // Arrange
            ChildSqlDAO dao = new ChildSqlDAO(this.connectionString);

            // Act
            int childId = dao.ReinstateChild(ellie, ruth);

            // Assert
            Assert.AreEqual(ellie, childId);
        }
예제 #4
0
        public void TestGetDeactivatedChildren()
        {
            // Arrange
            ChildSqlDAO dao = new ChildSqlDAO(this.connectionString);

            // Act
            List <Child> children = dao.GetDeactivedChildren(ruth);

            //Assert
            Assert.AreEqual(2, children.Count);
        }
예제 #5
0
        public void TestUpdateChild()
        {
            // Arrange
            ChildSqlDAO dao      = new ChildSqlDAO(this.connectionString);
            Child       newChild = new Child()
            {
                FirstName    = "El",
                LastName     = "Kweicen",
                Gender       = 'F',
                DateOfBirth  = DateTime.Now,
                RatePerHour  = 6.30M,
                NeedsDiapers = true,
                ImageUrl     = ""
            };

            // Act
            Child updateChild = dao.UpdateChild(newChild, ellie, ruth);

            // Assert
            Assert.AreEqual("El", updateChild.FirstName);
        }