Exemple #1
0
        public void StartUpdatingBudgetAccount_WhenAccountNumberIsNotNullEmptyOrWhiteSpace_ReturnsPartialViewResultWhereViewNameIsEqualToUpdatingBudgetAccountPartial()
        {
            Controller sut = CreateSut();

            PartialViewResult result = (PartialViewResult)sut.StartUpdatingBudgetAccount(_fixture.Create <int>(), _fixture.Create <string>());

            Assert.That(result.ViewName, Is.EqualTo("_UpdatingBudgetAccountPartial"));
        }
Exemple #2
0
        public void StartUpdatingBudgetAccount_WhenAccountNumberIsNotNullEmptyOrWhiteSpace_ReturnsPartialViewResult()
        {
            Controller sut = CreateSut();

            IActionResult result = sut.StartUpdatingBudgetAccount(_fixture.Create <int>(), _fixture.Create <string>());

            Assert.That(result, Is.TypeOf <PartialViewResult>());
        }
Exemple #3
0
        public void StartUpdatingBudgetAccount_WhenAccountNumberIsNotNullEmptyOrWhiteSpace_ReturnsPartialViewResultWhereModelIsAccountIdentificationViewModel()
        {
            Controller sut = CreateSut();

            PartialViewResult result = (PartialViewResult)sut.StartUpdatingBudgetAccount(_fixture.Create <int>(), _fixture.Create <string>());

            Assert.That(result.Model, Is.TypeOf <AccountIdentificationViewModel>());
        }
Exemple #4
0
        public void StartUpdatingBudgetAccount_WhenAccountNumberIsNotNullEmptyOrWhiteSpace_ReturnsPartialViewResultWhereModelIsAccountIdentificationViewModelWithAccountingNotEqualToNull()
        {
            Controller sut = CreateSut();

            PartialViewResult result = (PartialViewResult)sut.StartUpdatingBudgetAccount(_fixture.Create <int>(), _fixture.Create <string>());

            AccountIdentificationViewModel accountIdentificationViewModel = (AccountIdentificationViewModel)result.Model;

            Assert.That(accountIdentificationViewModel.Accounting, Is.Not.Null);
        }
Exemple #5
0
        public void StartUpdatingBudgetAccount_WhenAccountNumberIsWhiteSpace_ThrowsArgumentNullException()
        {
            Controller sut = CreateSut();

            ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.StartUpdatingBudgetAccount(_fixture.Create <int>(), " "));

            // ReSharper disable PossibleNullReferenceException
            Assert.That(result.ParamName, Is.EqualTo("accountNumber"));
            // ReSharper restore PossibleNullReferenceException
        }