public async Task CreateCurrency_ValidCurrencyName_CreateAndReturnCurrency() { var currencyName = "testCurrency"; var newCurrency = new Currency { Id = Guid.NewGuid(), Name = currencyName }; _service.Setup(s => s.CreateCurrencyAsync(currencyName)) .ReturnsAsync(newCurrency); _mapper.Setup(m => m.Map <Currency, CurrencyResource>(newCurrency)) .Returns(new CurrencyResource { Id = newCurrency.Id, Name = newCurrency.Name }); var response = await _controller.CreateCurrencyAsync(currencyName); var result = response.Result as ObjectResult; Assert.Equal((int)HttpStatusCode.OK, result.StatusCode); Assert.NotNull(result.Value); Assert.IsType(typeof(CurrencyResource), result.Value); ResetMocks(); }