예제 #1
0
        public void Stop_ReturnsActionStatusOk()
        {
            valveManager.valves.Add(ServiceProvider.GetRequiredService <IValve>());
            ActionStatus actionStatus = valveManager.Stop();

            Assert.AreEqual(ActionStatus.OK, actionStatus);
        }
예제 #2
0
        public void Stop_SetsIsStopRequested()
        {
            //Arrange
            for (int i = 0; i < 4; i++)
            {
                Mock <IValve> valveMock = new Mock <IValve>().SetupProperty(m => m.IsStopRequested);
                valveManager.valves.Add(valveMock.Object);
            }
            bool valveWithoutStopRequestExist = false;

            //Act
            valveManager.Stop();
            foreach (IValve valve in valveManager.valves)
            {
                if (valve.IsStopRequested == false)
                {
                    valveWithoutStopRequestExist = true;
                }
            }
            //Assert
            Assert.IsFalse(valveWithoutStopRequestExist);
        }