public void TestValidGetId() { var carAdvert = new CarAdvert() { Id = 1, Title = "Audi", Price = 1500, Fuel = FuelType.Diesel, IsNew = true }; var vm = Substitute.For <IViewModel <CarAdvert> >(); vm.Get(Arg.Any <int>()).Returns(c => carAdvert); var controller = new CarAdvertController(vm, CreateMappings()); var result = controller.Get(1) as OkNegotiatedContentResult <CarAdvertDto>; Assert.IsNotNull(result); var item = result.Content; Assert.AreEqual(item.Id, 1); Assert.AreEqual(item.Title, "Audi"); Assert.AreEqual(item.Price, 1500); Assert.AreEqual(item.Fuel, "diesel"); Assert.AreEqual(item.New, true); }