Example #1
0
        public void Test_WithNonSecurableObject_DoesNotPerformSecurityCheck()
        {
            NonSecurableObject nonSecurableObject = _testHelper.CreateNonSecurableObject();

            _testHelper.ReplayAll();
            var endPointDefinition = nonSecurableObject.ID.ClassDefinition.GetRelationEndPointDefinition(typeof(NonSecurableObject).FullName + ".Parent");

            _extension.RelationChanging(_testHelper.Transaction, nonSecurableObject, endPointDefinition, null, null);

            _testHelper.VerifyAll();
        }
        public void Test_WithNonSecurableObject_DoesNotPerformSecurityCheck()
        {
            NonSecurableObject nonSecurableObject = _testHelper.CreateNonSecurableObject();

            _testHelper.Transaction.Commit();
            _testHelper.ReplayAll();

            _extension.ObjectDeleting(_testHelper.Transaction, nonSecurableObject);

            _testHelper.VerifyAll();
        }
        public void Test_WithNonSecurableObject_ReturnsObjects()
        {
            NonSecurableObject nonSecurableObject = _testHelper.CreateNonSecurableObject();
            IQuery             query = MockRepository.GenerateStub <IQuery>();
            var queryResult          = new QueryResult <DomainObject> (query, new DomainObject[] { nonSecurableObject });

            _testHelper.ReplayAll();

            var finalResult = _extension.FilterQueryResult(_testHelper.Transaction, queryResult);

            _testHelper.VerifyAll();
            Assert.That(finalResult.ToArray(), Is.EqualTo(new[] { nonSecurableObject }));
        }
Example #4
0
        public void Test_WithNonSecurableObject_DoesNotPerformSecurityCheck()
        {
            var propertyInfo = typeof(NonSecurableObject).GetProperty("StringProperty");
            NonSecurableObject nonSecurableObject = _testHelper.CreateNonSecurableObject();

            _testHelper.ReplayAll();

            _extension.PropertyValueReading(
                _testHelper.Transaction,
                nonSecurableObject,
                PropertyDefinitionObjectMother.CreatePropertyDefinition(propertyInfo, typeof(NonSecurableObject)),
                ValueAccess.Current);

            _testHelper.VerifyAll();
        }
 public NonSecurableObject CreateNonSecurableObject()
 {
     return(NonSecurableObject.NewObject(_transaction));
 }