public void UpdateSubjectTest() { var service = new Service1(); Subject subject = new Subject { Name = "foo", }; Subject subjectPrev = new Subject(); subjectPrev = service.AddSubject(subject); Subject subjectPlug = new Subject(); subjectPlug = subjectPrev; subjectPlug.Name = "bar"; service.UpdateSubject(subjectPlug); Subject subjectPost = new Subject(); subjectPost = service.FindByIDSubject(subjectPost.ID_Subject); service.DeleteSubject(subjectPlug.ID_Subject); Assert.AreNotEqual(subjectPrev, subjectPost); }
public void AddSubjectTest2() { var service = new Service1(); Subject subjectPrev = new Subject { Name = "foo", }; Subject subjectPost = new Subject(); subjectPost = service.AddSubject(subjectPrev); service.DeleteSubject(subjectPost.ID_Subject); Assert.AreEqual(subjectPrev, subjectPost); }
public void AddSubjectTest() { var service = new Service1(); var subjectColPrev = service.SelectSubject().Count; Subject subject = new Subject { Name = "foo", }; Subject subject2 = new Subject(); subject2 = service.AddSubject(subject); var subjectColPost = service.SelectSubject().Count; service.DeleteSubject(subject2.ID_Subject); Assert.AreEqual(subjectColPrev + 1, subjectColPost); }