Exemplo n.º 1
0
        public void ToDomain_WhenBudgetAccountIsNotNull_ReturnsBudgetInfo()
        {
            IBudgetInfoCommand sut = CreateSut();

            IBudgetInfo result = sut.ToDomain(_fixture.BuildBudgetAccountMock().Object);

            Assert.That(result, Is.TypeOf <BudgetInfo>());
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
        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));
        }
Exemplo n.º 7
0
        public void ToDomain_WhenBudgetAccountIsNull_ThrowsArgumentNullException()
        {
            IBudgetInfoCommand sut = CreateSut();

            ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.ToDomain(null));

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