private BicycleResponseViewModel MapResponse(ORM.Bicycle bicycle) { return(new BicycleResponseViewModel { BicyleCondition = Enum.GetName(typeof(BicyleCondition), bicycle.BicyleCondition), CreatedOn = bicycle.CreatedOn, Model = bicycle.Model, Id = bicycle.Id }); }
public async Task should_add_bicycle() { var expected = new ORM.Bicycle { BicyleCondition = Helper.BicyleCondition.good, CreatedOn = DateTime.Now, Id = 1, Model = "Honda" }; var result = await _BicycleRepository.InsertAsync(expected); Assert.AreEqual(1, result.Id); }
public async Task should_get_bicycle() { var objectData = new ORM.Bicycle { BicyleCondition = Helper.BicyleCondition.good, CreatedOn = DateTime.Now, Id = 1, Model = "Honda" }; var result = await _BicycleRepository.InsertAsync(objectData); var response = await _BicycleRepository.GetAsync(1); Assert.AreEqual(1, result.Id); Assert.AreEqual("Honda", response.Model); }