コード例 #1
0
        public void Test_EnsureAuthorised_AllowPublicType()
        {
            CreateController controller = new CreateController();

            controller.Container = new MockCreateProjection(typeof(MockPublicEntity));
            bool isAuthorised = controller.EnsureAuthorised();

            Assert.IsTrue(isAuthorised, "Returned false when it should be true.");
        }
コード例 #2
0
        public void Test_EnsureAuthorised_RestrictUnauthorisedType()
        {
            MockRestrictedEntity restrictedEntity = new MockRestrictedEntity();

            CreateController controller = new CreateController();

            controller.Container = new MockCreateProjection(typeof(MockRestrictedEntity));
            bool isAuthorised = controller.EnsureAuthorised();

            Assert.IsFalse(isAuthorised, "Returned true when it should have been false.");
        }