Exemplo n.º 1
0
        public PropertyAccessorFactoryTests()
        {
            referenceCheckerMock = Substitute.For <IObjectReferenceChecker>();

            var collectionCheckerMock = Substitute.For <IObjectCollectionChecker>();

            var attributeProviderStub = Substitute.For <IMemberAttributeProvider>();

            // To test the logic of a factory, the providers it uses are not important, so they are replaced with stubs.
            sut = new LambdaPropertyAccessorFactory(referenceCheckerMock, collectionCheckerMock, attributeProviderStub);
        }
Exemplo n.º 2
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="referenceChecker"></param>
 /// <param name="collectionChecker"></param>
 /// <param name="attributeProvider"></param>
 public LambdaPropertyAccessorFactory(IObjectReferenceChecker referenceChecker, IObjectCollectionChecker collectionChecker, IMemberAttributeProvider attributeProvider)
 {
     this.referenceChecker  = referenceChecker;
     this.collectionChecker = collectionChecker;
     this.attributeProvider = attributeProvider;
 }
 public ObjectReferenceCheckerTests()
 {
     sut = new ReflectionReferenceChecker();
 }