public void DebugMessageWrittenIfAllowed() { _message.Class.Returns(MessageClass.DebugMsg); _filter.AllowDebugMessages.Returns(true); _sut.Write(_message); _mockWriter.Received().Write(_message); }
public void WillWriteIfTheOnlyLogFlagIsNotSet() { var msg = Substitute.For <IMessage>(); msg.OnlyLog.Returns(false); _sut.Write(msg); _mockWriter.Received().Write(msg); }
public void ShouldReportPositionAndFacingDirection([Range(0, TableSize)] int xPosition, [Range(0, TableSize)] int yPosition, SouthFacingDirection facingDirection) { _robot.Place(xPosition, yPosition, facingDirection); _robot.Report(); _messageWriterMock.Received(1).Write($"Current position: ({xPosition}, {yPosition}), Facing: {facingDirection.ToString()}"); }
public void should_call_inner_writer() { _sut.Write(Message); _writer.Received().Write(Message); }