예제 #1
0
        public void PeopleServiceCrudTest()
        {
            // ARRANGE
            var model = new PersonModel {
                FirstName = "Phil", LastName = "Collson"
            };

            // Create & Read
            service.InsertModel(model);
            var read = service.GetAll().FirstOrDefault(m => m.FirstName == "Phil" && m.LastName == "Collson");

            Assert.IsNotNull(read);

            model.Id       = read.Id;
            model.LastName = "Coulson";
            service.UpdateModel(model);
            var read2 = service.GetAll().FirstOrDefault(m => m.FirstName == "Phil" && m.LastName == "Coulson");

            Assert.IsNotNull(read2);

            service.DeleteModel(read);
            var read3 = service.GetAll().FirstOrDefault(m => m.FirstName == "Phil" && m.LastName == "Coulson");

            Assert.IsNull(read3);
        }