public void DisposeNoExceptionNoBatchingAndCaching()
        {
            // arrange
            FetchDataDelegate <string, string> fetch = CreateFetch <string, string>();
            var batchScheduler = new ManualBatchScheduler();
            var loader         = new DataLoader <string, string>(fetch, batchScheduler);

            // act
            void Verify() => loader.Dispose();

            // assert
            Assert.Null(Record.Exception(Verify));
        }
示例#2
0
        public void DisposeNoExceptionNobatchingAndCaching()
        {
            // arrange
            FetchDataDelegate <string, string> fetch = TestHelpers.CreateFetch <string, string>();
            var batchScheduler = new ManualBatchScheduler();
            var loader         = new DataLoader <string, string>(batchScheduler, fetch);

            // act
            Action verify = () => loader.Dispose();

            // assert
            Assert.Null(Record.Exception(verify));
        }
示例#3
0
        public void DisposeNoException()
        {
            // arrange
            FetchDataDelegate <string, string> fetch = async keys =>
                                                       await Task.FromResult(new IResult <string> [0])
                                                       .ConfigureAwait(false);

            var options = new DataLoaderOptions <string>();
            var loader  = new DataLoader <string, string>(options, fetch);

            // act
            Action verify = () => loader.Dispose();

            // assert
            Assert.Null(Record.Exception(verify));
        }