Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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));
        }