public LoadLinkByIdsTests() { var loadLinkProtocolBuilder = new LoadLinkProtocolBuilder(); loadLinkProtocolBuilder.For <PersonLinkedSource>() .LoadLinkReferenceById( linkedSource => linkedSource.Model.SummaryImageId, linkedSource => linkedSource.SummaryImage); _referenceLoaderStub = new ReferenceLoaderStub(); _sut = loadLinkProtocolBuilder.Build(() => _referenceLoaderStub); }
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); }
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); }
public LoadTests() { _referenceLoaderStub = new ReferenceLoaderStub(); _sut = new LoadLinkProtocolBuilder().Build(() => _referenceLoaderStub); }