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."); }
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."); }