Esempio n. 1
0
        public void ShouldDoWaterAccountingPersonsShares()
        {
            WaterAccountingPersonsSharesModel wapsm = new WaterAccountingPersonsSharesModel();
            double result = (double)wapsm.DoAccounting(100);

            Assert.AreEqual(179.8536, result, 0.001);
        }
Esempio n. 2
0
        public void DoAccountingConsumptionZeroReturnsFixedExpenses()
        {
            WaterAccountingPersonsSharesModel wapsm = GetWaterAccountingPersonsSharesModel();
            double expected = (double)ConstantsBusiness.WaterBillFixedAmount;
            double result   = (double)wapsm.DoAccounting(0);

            Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, result, 0.001);
        }
Esempio n. 3
0
        public void DoAccountingNegativeConsumptionThrowsException()
        {
            WaterAccountingPersonsSharesModel wapsm = GetWaterAccountingPersonsSharesModel();
            var input = -100;

            try
            {
                wapsm.DoAccounting(input);
                Assert.Fail();
            }
            catch (ArgumentException expected)
            {
                Assert.AreEqual("Consumption can not be negative", expected.Message);
            }
        }