Exemplo n.º 1
0
        public void PortalGroupController_DeletePortalGroup_Throws_On_Negative_PortalGroupId()
        {
            //Arrange
            var mockDataService = new Mock<IDataService>();
            var mockPortalController = new Mock<IPortalController>();
            var controller = new PortalGroupController(mockDataService.Object, mockPortalController.Object);

            PortalGroupInfo portalGroup = CreateValidPortalGroup();
            portalGroup.PortalGroupId = Null.NullInteger;

            //Act, Assert
            controller.DeletePortalGroup(portalGroup);
        }
Exemplo n.º 2
0
        public void PortalGroupController_DeletePortalGroup_Calls_DataService_On_Valid_PortalGroupId()
        {
            //Arrange
            MockComponentProvider.CreateNew<CachingProvider>();
            var mockDataService = new Mock<IDataService>();
            var mockPortalController = new Mock<IPortalController>();
            var controller = new PortalGroupController(mockDataService.Object, mockPortalController.Object);

            PortalGroupInfo portalGroup = CreateValidPortalGroup();
            portalGroup.PortalGroupId = Constants.PORTALGROUP_DeletePortalGroupId;

            //Act
            controller.DeletePortalGroup(portalGroup);

            //Assert
            mockDataService.Verify(ds => ds.DeletePortalGroup(portalGroup));
        }
Exemplo n.º 3
0
        public void PortalGroupController_DeletePortalGroup_Throws_On_Null_PortalGroup()
        {
            //Arrange
            var mockDataService = new Mock<IDataService>();
            var mockPortalController = new Mock<IPortalController>();
            var controller = new PortalGroupController(mockDataService.Object, mockPortalController.Object);

            //Act, Assert
            controller.DeletePortalGroup(null);
        }