示例#1
0
        public void PowerConfigurationProcessクラスのSetActiveメソッドが実行されること()
        {
            var mock = new Mock<PowerConfigurationProcess.Interface>();

            var input = new PowerPlan();

            var target = new PowerConfiguration();
            target.PowerConfigurationProcess = mock.Object;
            target.SetActive(input);

            mock.Verify(x => x.SetActive(input), Times.Once);
            mock.VerifyAll();
        }
示例#2
0
        public void PowerConfigurationProcessクラスのGetPowerPlansメソッドが実行されること()
        {
            var expected = new PowerPlan[] {
                new PowerPlan(),
                new PowerPlan(),
            };

            var mock = new Mock<PowerConfigurationProcess.Interface>();
            mock.Setup(x => x.GetPowerPlans()).Returns(expected);

            var target = new PowerConfiguration();
            target.PowerConfigurationProcess = mock.Object;
            var actuals = target.GetPowerPlans();

            CollectionAssert.AreEqual(expected, actuals);

            mock.Verify(x => x.GetPowerPlans(), Times.Once);
            mock.VerifyAll();
        }