예제 #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);
            }