예제 #1
0
        public LoadLinkByIdsTests()
        {
            var loadLinkProtocolBuilder = new LoadLinkProtocolBuilder();

            loadLinkProtocolBuilder.For <PersonLinkedSource>()
            .LoadLinkReferenceById(
                linkedSource => linkedSource.Model.SummaryImageId,
                linkedSource => linkedSource.SummaryImage);

            _referenceLoaderStub = new ReferenceLoaderStub();
            _sut = loadLinkProtocolBuilder.Build(() => _referenceLoaderStub);
        }
예제 #2
0
        public async Task LoadLink_ShouldDisposeLoader()
        {
            var loadLinkProtocolBuilder = new LoadLinkProtocolBuilder();

            loadLinkProtocolBuilder.For <PersonLinkedSource>()
            .LoadLinkReferenceById(
                linkedSource => linkedSource.Model.SummaryImageId,
                linkedSource => linkedSource.SummaryImage);
            var sut            = new ReferenceLoaderStub();
            var loadLinkConfig = loadLinkProtocolBuilder.Build(() => sut);

            await loadLinkConfig.LoadLink <PersonLinkedSource>().ByIdAsync("dont-care");

            Assert.True(sut.IsDisposed);
        }
예제 #3
0
        public NestedLinkedSourceTests()
        {
            var loadLinkProtocolBuilder = new LoadLinkProtocolBuilder();

            loadLinkProtocolBuilder.For <NestedLinkedSource>()
            .LoadLinkNestedLinkedSourceById(
                linkedSource => linkedSource.Model.AuthorDetailId,
                linkedSource => linkedSource.AuthorDetail)
            .LoadLinkReferenceById(
                linkedSource => linkedSource.Model.ClientSummaryId,
                linkedSource => linkedSource.ClientSummary);

            loadLinkProtocolBuilder.For <PersonLinkedSource>()
            .LoadLinkReferenceById(
                linkedSource => linkedSource.Model.SummaryImageId,
                linkedSource => linkedSource.SummaryImage);

            _referenceLoaderStub = new ReferenceLoaderStub();
            _sut = loadLinkProtocolBuilder.Build(() => _referenceLoaderStub);
        }
예제 #4
0
 public LoadTests()
 {
     _referenceLoaderStub = new ReferenceLoaderStub();
     _sut = new LoadLinkProtocolBuilder().Build(() => _referenceLoaderStub);
 }