Пример #1
0
        public void AddMonthlyConsumptionReturnsFalse()
        {
            List <MonthlyConsumption> testData = null;
            var mock = new Mock <IPlantSetupDal>();

            mock.Setup(x => x.AddMonthlyConsumption(testData, "2017", 1, 1)).Returns(true);
            var plantManager = new PlantSetUpManager(mock.Object);
            var result       = plantManager.AddMonthlyConsumption(testData, "2017", 1, 1);

            Assert.IsNotNull(result);
            Assert.IsFalse(result);
        }
Пример #2
0
        public void AddMonthlyConsumptionReturnsTrue()
        {
            var testData = new List <MonthlyConsumption> {
                new MonthlyConsumption {
                    Consumption = 12.00, Cost = 23.45, UOM = "kwh", UOMID = 1, WAGES = "Electricity", WagesId = 1
                },
                new MonthlyConsumption {
                    Consumption = 13.00, Cost = 43.45, UOM = "kwh", UOMID = 2, WAGES = "Electricity", WagesId = 1
                }
            };
            var mock = new Mock <IPlantSetupDal>();

            mock.Setup(x => x.AddMonthlyConsumption(testData, "2017", 1, 1)).Returns(true);
            var plantManager = new PlantSetUpManager(mock.Object);
            var result       = plantManager.AddMonthlyConsumption(testData, "2017", 1, 1);

            Assert.IsNotNull(result);
            Assert.IsTrue(result);
        }