public void Accountings_WhenAccountingNumberIsNullAndAccountingNumberWasNotReturnedFromClaimResolver_ReturnsViewResultWhereModelIsAccountingOptionsViewModelWhereDefaultAccountingNumberIsNull() { Controller sut = CreateSut(false); ViewResult result = (ViewResult)sut.Accountings(); AccountingOptionsViewModel accountingOptionsViewModel = (AccountingOptionsViewModel)result.Model; Assert.That(accountingOptionsViewModel.DefaultAccountingNumber, Is.Null); }
public void StartCreatingAccounting_WhenCalled_ReturnsPartialViewResultWhereModelIsAccountingOptionsViewModelWithoutDefaultAccountingNumber() { Controller sut = CreateSut(); PartialViewResult result = (PartialViewResult)sut.StartCreatingAccounting(); AccountingOptionsViewModel accountingOptionsViewModel = (AccountingOptionsViewModel)result.Model; Assert.That(accountingOptionsViewModel.DefaultAccountingNumber, Is.Null); }
public void Accountings_WhenAccountingNumberIsNotNull_ReturnsViewResultWhereModelIsAccountingOptionsViewModelWhereDefaultAccountingNumberIsEqualToAccountingNumberArgument() { Controller sut = CreateSut(); int accountingNumber = _fixture.Create <int>(); ViewResult result = (ViewResult)sut.Accountings(accountingNumber); AccountingOptionsViewModel accountingOptionsViewModel = (AccountingOptionsViewModel)result.Model; Assert.That(accountingOptionsViewModel.DefaultAccountingNumber, Is.EqualTo(accountingNumber)); }
public void Accountings_WhenAccountingNumberIsNullAccountingNumberWasReturnedFromClaimResolver_ReturnsViewResultWhereModelIsAccountingOptionsViewModelWhereDefaultAccountingNumberIsEqualToAccountingNumberFromClaimResolver() { int accountingNumber = _fixture.Create <int>(); Controller sut = CreateSut(accountingNumber: accountingNumber); ViewResult result = (ViewResult)sut.Accountings(); AccountingOptionsViewModel accountingOptionsViewModel = (AccountingOptionsViewModel)result.Model; Assert.That(accountingOptionsViewModel.DefaultAccountingNumber, Is.EqualTo(accountingNumber)); }
public void StartLoadingAccountings_WhenCalledWithAccountingNumber_ReturnsPartialViewResultWhereModelIsAccountingOptionsViewModelWithDefaultAccountingNumberEqualToAccountingNumber() { Controller sut = CreateSut(); int accountingNumber = _fixture.Create <int>(); PartialViewResult result = (PartialViewResult)sut.StartLoadingAccountings(accountingNumber); AccountingOptionsViewModel accountingOptionsViewModel = result.Model as AccountingOptionsViewModel; Assert.That(accountingOptionsViewModel, Is.Not.Null); Assert.That(accountingOptionsViewModel.DefaultAccountingNumber, Is.EqualTo(accountingNumber)); }