Пример #1
0
        public void FlowIsValid()
        {
            // Arrange
            var writer = Substitute.For <IWriter>();
            var flow   = new Flow4 {
                Writer = writer
            };

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

            // Assert
            Assert.That(validationResult.HasErrors, Is.False);
        }
Пример #2
0
        public void RunCase(int number, string message)
        {
            // Arrange
            var writer = Substitute.For <IWriter>();
            var flow   = new Flow4
            {
                Number = number,
                Writer = writer
            };

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

            // Assert
            writer.Received().Write(message);
        }