AssertAllEventsAreUnregistered() публичный Метод

public AssertAllEventsAreUnregistered ( ) : void
Результат void
        public void Helpers_RunOnFinished()
        {
            // Setup
            ConfigurableProgressEvents progressEvents = new ConfigurableProgressEvents();
            ProgressControllerResult? result = null;
            Action<ProgressControllerResult> action = (r) => result = r;

            foreach (ProgressControllerResult progressResult in Enum.GetValues(typeof(ProgressControllerResult)))
            {
                result = null;
                Helpers.RunOnFinished(progressEvents, action);

                // Act
                progressEvents.InvokeFinished(progressResult);

                // Verify
                Assert.AreEqual(progressResult, result, "Action was not called");
                progressEvents.AssertAllEventsAreUnregistered();
            }
        }
Пример #2
0
        public void Helpers_RunOnFinished()
        {
            // Arrange
            ConfigurableProgressEvents        progressEvents = new ConfigurableProgressEvents();
            ProgressControllerResult?         result         = null;
            Action <ProgressControllerResult> action         = (r) => result = r;

            foreach (ProgressControllerResult progressResult in Enum.GetValues(typeof(ProgressControllerResult)))
            {
                result = null;
                Helpers.RunOnFinished(progressEvents, action);

                // Act
                progressEvents.InvokeFinished(progressResult);

                // Assert
                result.Should().Be(progressResult, "Action was not called");
                progressEvents.AssertAllEventsAreUnregistered();
            }
        }