public void ToDomain_WhenBudgetAccountIsNotNull_ReturnsBudgetInfo() { IBudgetInfoCommand sut = CreateSut(); IBudgetInfo result = sut.ToDomain(_fixture.BuildBudgetAccountMock().Object); Assert.That(result, Is.TypeOf <BudgetInfo>()); }
public void ToDomain_WhenBudgetAccountIsNotNull_ReturnsBudgetInfoWhereIncomeIsEqualToIncomeInBudgetInfoCommand() { decimal income = _fixture.Create <decimal>(); IBudgetInfoCommand sut = CreateSut(income: income); IBudgetInfo result = sut.ToDomain(_fixture.BuildBudgetAccountMock().Object); Assert.That(result.Income, Is.EqualTo(income)); }
public void ToDomain_WhenBudgetAccountIsNotNull_ReturnsBudgetInfoWhereMonthIsEqualToMonthInBudgetInfoCommand() { short month = (short)_random.Next(BudgetInfo.MinMonth, BudgetInfo.MaxMonth); IBudgetInfoCommand sut = CreateSut(month: month); IBudgetInfo result = sut.ToDomain(_fixture.BuildBudgetAccountMock().Object); Assert.That(result.Month, Is.EqualTo(month)); }
public void ToDomain_WhenBudgetAccountIsNotNull_ReturnsBudgetInfoWhereYearIsEqualToYearInBudgetInfoCommand() { short year = (short)_random.Next(BudgetInfo.MinYear, BudgetInfo.MaxYear); IBudgetInfoCommand sut = CreateSut(year); IBudgetInfo result = sut.ToDomain(_fixture.BuildBudgetAccountMock().Object); Assert.That(result.Year, Is.EqualTo(year)); }
public void ToDomain_WhenBudgetAccountIsNotNull_ReturnsBudgetInfoWhereBudgetAccountIsEqualToArgument() { IBudgetInfoCommand sut = CreateSut(); IBudgetAccount budgetAccount = _fixture.BuildBudgetAccountMock().Object; IBudgetInfo result = sut.ToDomain(budgetAccount); Assert.That(result.BudgetAccount, Is.EqualTo(budgetAccount)); }
public void ToDomain_WhenBudgetAccountIsNotNull_ReturnsBudgetInfoWhereExpensesIsEqualToExpensesInBudgetInfoCommand() { decimal expenses = _fixture.Create <decimal>(); IBudgetInfoCommand sut = CreateSut(expenses: expenses); IBudgetInfo result = sut.ToDomain(_fixture.BuildBudgetAccountMock().Object); Assert.That(result.Expenses, Is.EqualTo(expenses)); }
public void ToDomain_WhenBudgetAccountIsNull_ThrowsArgumentNullException() { IBudgetInfoCommand sut = CreateSut(); ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.ToDomain(null)); Assert.That(result.ParamName, Is.EqualTo("budgetAccount")); }