public void Calculate_AddsToLogString_WhenCalled() { // Arrange m_Wire.GetSignal().Returns(true); // Act m_Sut.Calculate(TimeDoesNotMatter); // Assert Assert.AreEqual("[0,1]", m_Sut.GetLog()); }
public void Calculate_SetsWireOutToFalse_ForWireInIsTrue() { // Arrange Inverter sut = CreateSut(m_WireIn, m_WireOut); m_WireIn.SetSignal(TimeDoesNotMatter, true); // Act sut.Calculate(0); // Assert m_WireOut.GetSignal().ShouldBeFalse(); }
public void Calculate(int time) { bool value = m_WireInOne.GetSignal() || m_WireInTwo.GetSignal(); m_WireOut.SetSignal(time, value); }
public void ThenTheWireOrOutputIsTrue(string wireName, bool expected) { IWire wire = GetWireFromContext(wireName); SleepWaitAndDo(() => IsExpectedOutputSignal(expected, wire), DoNothing); bool actual = wire.GetSignal(); Assert.AreEqual(expected, actual); }
public void FunctionUnderTest_ExpectedResult_UnderCondition(bool inputOne, bool inputTwo, bool expected) { // Arrange m_WireInOne.GetSignal().Returns(inputOne); m_WireInTwo.GetSignal().Returns(inputTwo); // Act m_Sut.Calculate(0); // Assert m_WireOut.Received().SetSignal(TimeDoesNotMatter, expected); }
public bool GetSignal() { return(m_Wire.GetSignal()); }
private bool IsExpectedOutputSignal(bool expected, IWire wire) { return(expected == wire.GetSignal()); }
public void Calculate(int time) { m_WireOut.SetSignal(time, !m_WireIn.GetSignal()); }