Example #1
0
        public void RunCase(string inputNumber, string echoMessage)
        {
            // Arrange
            var reader = new ArrayReader(inputNumber);
            var writer = Substitute.For <IWriter>();
            var flow   = new Flow3 {
                Reader = reader, Writer = writer
            };

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

            // Assert
            writer.Received().Write(echoMessage);
        }
Example #2
0
        public void FlowIsValid()
        {
            // Arrange
            var reader = Substitute.For <IReader>();
            var writer = Substitute.For <IWriter>();
            var flow   = new Flow3 {
                Reader = reader, Writer = writer
            };

            // Act
            var validationResult = flow.Validate();

            // Assert
            Assert.That(validationResult.HasErrors, Is.False);
        }