Exemplo n.º 1
0
        public void UpdateTestMethod(Subject subject)
        {
            //arrange
            SubjectCreator stCreator = (SubjectCreator)factory.GetSubjectCreator();
            //act
            bool isUpdated = stCreator.Update(subject);

            //assert
            Assert.IsTrue(isUpdated);
        }
Exemplo n.º 2
0
        public void DeleteTestMethod(int id)
        {
            //arrange
            SubjectCreator stCreator = (SubjectCreator)factory.GetSubjectCreator();
            //act
            bool isDeleted = stCreator.Delete(id);

            //assert
            Assert.IsTrue(isDeleted);
        }
Exemplo n.º 3
0
        public void ReadTestMethod()
        {
            //arrange
            Subject expected = new Subject(1, "Math");
            //act
            SubjectCreator stCreator = (SubjectCreator)factory.GetSubjectCreator();
            Subject        actual    = stCreator.Read(1);

            //assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 4
0
        public void GetAllTestMethod()
        {
            //arrange
            SubjectCreator stCreator = (SubjectCreator)factory.GetSubjectCreator();
            List <Subject> expected  = new List <Subject> {
                new Subject(1, "Math"),
                new Subject(2, "Physics"),
                new Subject(3, "Philosophy"),
                new Subject(4, "Psychology")
            };
            //act
            List <Subject> actual = stCreator.GetAll().ToList();

            //assert
            CollectionAssert.AreEqual(expected, actual);
        }