public async Task DeleteCountry_WhenCalledWithCode_ReturnsRedirectToActionResultWhereControllerNameIsEqualToContact()
        {
            Controller sut = CreateSut();

            RedirectToActionResult result = (RedirectToActionResult)await sut.DeleteCountry(_fixture.Create <string>());

            Assert.That(result.ControllerName, Is.EqualTo("Contact"));
        }
        public async Task DeleteCountry_WhenCalledWithCode_ReturnsRedirectToActionResult()
        {
            Controller sut = CreateSut();

            IActionResult result = await sut.DeleteCountry(_fixture.Create <string>());

            Assert.That(result, Is.TypeOf <RedirectToActionResult>());
        }
        public async Task DeleteCountry_WhenCalledWithCode_AssertPublishAsyncWasCalledOnCommandBus()
        {
            Controller sut = CreateSut();

            string code = _fixture.Create <string>();
            await sut.DeleteCountry(code);

            _commandBusMock.Verify(m => m.PublishAsync(It.Is <IDeleteCountryCommand>(value => string.CompareOrdinal(value.CountryCode, code.ToUpper()) == 0)), Times.Once);
        }
        public void DeleteCountry_WhenCalledWithCodeWhereCodeIsWhiteSpace_ThrowsArgumentNullException()
        {
            Controller sut = CreateSut();

            ArgumentNullException result = Assert.ThrowsAsync <ArgumentNullException>(async() => await sut.DeleteCountry(" "));

            Assert.That(result.ParamName, Is.EqualTo("code"));
        }