Beispiel #1
0
        public void ShouldHaveCorrectErrorString()
        {
            var subjectUnderTest = new JsonProtocolWriterFormat();

            Assert.That(subjectUnderTest.LogError("ERROR!!!!!!").TrimStuffForCompare(),
                        Is.EqualTo(JsonStrings.CommandErrorOut().TrimStuffForCompare()));
        }
Beispiel #2
0
        public void ShouldLogError()
        {
            var logError = JsonStrings.CommandErrorOut();

            var format = Substitute.For <IProtocolWriterFormat>();

            format.LogError("ERROR!!!!!!").Returns(logError);

            var writer = Substitute.For <IWriteNext>();
            var reader = Substitute.For <IStormReader>();

            var subjectUnderTest = new StandardBoltWriter(writer, format, reader);

            subjectUnderTest.LogError("ERROR!!!!!!");

            writer.Received().Write(logError);
        }