Пример #1
0
            public void Should_Add_Action_To_Task()
            {
                // Given
                var task = new ActionTask("task");

                // When
                task.AddAction(c => { });

                // Then
                Assert.Equal(1, task.Actions.Count);
            }
Пример #2
0
            public void Should_Throw_If_Action_Is_Null()
            {
                // Given
                var task = new ActionTask("task");

                // When
                var result = Record.Exception(() => task.AddAction(null));

                // Then
                Assert.IsArgumentNullException(result, "action");
            }
Пример #3
0
            public void Should_Add_Action_To_Task()
            {
                // Given
                var task = new ActionTask("task");

                // When
                task.AddAction(c => { });

                // Then
                Assert.Single(task.Actions);
            }
Пример #4
0
            private void Should_Throw_If_Action_Is_Null()
            {
                // Given
                var task = new ActionTask("task");

                // When
                var exception = Record.Exception(() => task.AddAction(null));

                // Then
                Assert.IsType <ArgumentNullException>(exception);
                Assert.Equal("action", ((ArgumentNullException)exception).ParamName);
            }