public void CreateWeather_Test(double airPressure, double temperature, double weightValue) { //Arrange var fixture = new Fixture(); var weather = Fixtures.WeatherFixture(airPressure, temperature, weightValue); var mapper = Mapper.GetAutoMapper(); var weatherRepoMoq = WeatherMoqs.WeatherRepositoryMoq(mapper.Map <WeatherEntity>(weather)); var weatherSvc = new WeatherService(mapper, weatherRepoMoq.Object); //Act var newWeather = weatherSvc.CreateWeatherAsync(weather).Result; //Assert var actual = JsonConvert.SerializeObject(weather); var expected = JsonConvert.SerializeObject(newWeather); Assert.Equal(expected.Trim(), actual.Trim()); }