Пример #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   = new Flow1 {
                Reader = reader, Writer = writer
            };

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

            // Assert
            writer.Received().Write(expectedMessage);
        }
Пример #2
0
        public void FlowIsValid()
        {
            // Arrange
            var reader = Substitute.For <IReader>();
            var writer = Substitute.For <IWriter>();
            var flow   = new Flow1 {
                Reader = reader, Writer = writer
            };

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

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