Example #1
0
        public void RunCase(string first, string second, string expectedMessage)
        {
            // Arrange
            var reader = new ArrayReader(first, second);
            var writer = Substitute.For <IWriter>();
            var flow   = CreateFlow(reader, writer);

            // Act
            flow.RunAsync().Wait();

            // Assert
            writer.Received().Write(expectedMessage);
        }
Example #2
0
        public void RunCase(string inputNumber, string echoMessage)
        {
            // Arrange
            var reader = new ArrayReader(inputNumber);
            var writer = Substitute.For <IWriter>();
            var flow   = CreateFlow(reader, writer);

            // Act
            flow.RunAsync().Wait();

            // Assert
            writer.Received().Write(echoMessage);
        }
Example #3
0
        public void RunCase(string first, string second, int expectedSum)
        {
            // Arrange
            var reader = new ArrayReader(first, second);
            var flow   = new Flow9 {
                Reader = reader
            };

            // Act
            var result = flow.RunAsync().Result;

            // Assert
            Assert.That(result, Is.EqualTo(expectedSum));
        }