public void SetNextProcessedChannel_TwoValvesAndBothStarted_ActualProceseedValveSwitchesBetweenValves(int numberOfExecutions, int expectedActualProcessedValve) { valveManager.valves.Add(ServiceProvider.GetRequiredService <IValve>()); valveManager.valves.Add(ServiceProvider.GetRequiredService <IValve>()); valveManager.valves[0].IsStarted = true; valveManager.valves[1].IsStarted = true; for (int i = 0; i < numberOfExecutions; i++) { valveManager.SetNextProcessedValve(); } Assert.AreEqual(expectedActualProcessedValve, valveManager.ActualProcessedValve); }
public void SetNextProcessedValve_SetsProperActualProcessedValve(int startProcessedValve, int endProcessedValve, bool[] isStarted) { //Arrange for (int i = 0; i < 4; i++) { Mock <IValve> valveMock = new Mock <IValve>(); valveMock.SetupGet(m => m.IsStarted).Returns(isStarted[i]); valveManager.valves.Add(valveMock.Object); } valveManager.ActualProcessedValve = startProcessedValve; //Act valveManager.SetNextProcessedValve(); //Assert Assert.AreEqual(endProcessedValve, valveManager.ActualProcessedValve); }