public void GetSpecificDogById() { var adapter = new DogAdapterStub(); var dogId = adapter.GetAllDogs().First().Id; var dog = adapter.GetDogById(dogId); Assert.IsNotNull(dog); }
/// <summary> /// Gets the dog by identifier. /// </summary> /// <param name="id">The identifier.</param> /// <returns>The dog</returns> public ResponseItem<Dog> GetDogById(Guid id) { var adapter = new DogAdapterStub(); var dog = adapter.GetDogById(id); var result = (dog != null) ? ResultCodeEnum.Success : ResultCodeEnum.NotFound; return new ResponseItem<Dog>(result) { Data = dog }; }
public void UpdateDogsTest() { const string petName = "Roxy Dog"; var adapter = new DogAdapterStub(); var dog = adapter.GetAllDogs().First(); dog.Name = petName; adapter.UpdateDog(dog); var updatedDog = adapter.GetDogById(dog.Id); Assert.AreEqual(petName, updatedDog.Name); }