Exemple #1
0
        public void PostEditAdminField_save_calls_correct_methods()
        {
            // Given
            var          model  = new EditAdminFieldViewModel(1, "Test", "Options");
            const string action = "save";

            A.CallTo(
                () => courseAdminFieldsService.UpdateCustomPromptForCourse(
                    1,
                    1,
                    "Options"
                    )
                ).DoesNothing();

            // When
            var result = controller.EditAdminField(1, model, action);

            // Then
            A.CallTo(
                () => courseAdminFieldsService.UpdateCustomPromptForCourse(
                    1,
                    1,
                    "Options"
                    )
                ).MustHaveHappened();
            result.Should().BeRedirectToActionResult().WithActionName("Index");
        }
Exemple #2
0
        public void UpdateCustomPromptForCourse_calls_data_service()
        {
            // Given
            A.CallTo(() => courseAdminFieldsDataService.UpdateCustomPromptForCourse(1, 1, null)).DoesNothing();

            // When
            courseAdminFieldsService.UpdateCustomPromptForCourse(1, 1, null);

            // Then
            A.CallTo(() => courseAdminFieldsDataService.UpdateCustomPromptForCourse(1, 1, null)).MustHaveHappened();
        }