public void ShouldHaveCorrectAcknowledgeString() { var subjectUnderTest = new JsonProtocolWriterFormat(); Assert.That(subjectUnderTest.Acknowledge(1231231).TrimStuffForCompare(), Is.EqualTo(JsonStrings.CommandAckOut().TrimStuffForCompare())); }
public void ShouldWriteStuffWithAnEnd() { var json = JsonStrings.CommandAckOut(); var rawWriter = Substitute.For <ICommunication>(); var subjectUnderTest = new WriteStringWithEndTerminator(rawWriter); subjectUnderTest.Write(json); rawWriter.Received().WriteLine(json); rawWriter.Received().WriteLine("end"); rawWriter.Received().Flush(); }
public void ShouldAcknowledge() { var acknowledge = JsonStrings.CommandAckOut(); var format = Substitute.For <IProtocolWriterFormat>(); format.Acknowledge(123123).Returns(acknowledge); var writer = Substitute.For <IWriteNext>(); var reader = Substitute.For <IStormReader>(); var subjectUnderTest = new StandardBoltWriter(writer, format, reader); subjectUnderTest.Acknowledge(123123); writer.Received().Write(acknowledge); }