public void SalespersonControllerTest_GetAll() { SalespersonController controller = new SalespersonController(); var people = controller.Get(); Assert.AreNotEqual(0, people.ToList().Count); }
public void SalespersonControllerTest_Get() { SalespersonController controller = new SalespersonController(); var person = controller.Get(1); const string name = "Mike"; Assert.AreEqual(name, person.Name); }
public void SalespersonControllerTest_PUT() { SalespersonController controller = new SalespersonController(); var person = controller.Get(3); string nameOld = person.Name; string nameNew = "Watson"; person.Name = nameNew; controller.Put(person.Id, person); person = null; person = controller.Get(3); Assert.AreEqual(nameNew, person.Name); person.Name = nameOld; controller.Put(person.Id, person); }
public void SalespersonControllerTest_POST_DELETE() { SalespersonController controller = new SalespersonController(); var person = new Salesperson() { Id = 0, Name = "Controller", LastName = "Test" }; controller.Post(person); person = controller.Get().ToList().SingleOrDefault(x => { return(x.Name.Equals(person.Name) && x.LastName.Equals(person.LastName)); }); controller.Delete(person.Id); }