public DataLoaderInfo(DataLoaderDescriptor descriptor, object instance) { _descriptor = descriptor ?? throw new ArgumentNullException(nameof(descriptor)); Instance = instance ?? throw new ArgumentNullException(nameof(instance)); NeedsToBeTriggered = _descriptor.TriggerLoadAsync != null; }
public void CreateDataLoaderDescriptor() { // act var descriptor = new DataLoaderDescriptor( "123", typeof(string), ExecutionScope.Global, sp => "foo", (d, c) => null); // assert Assert.Equal("123", descriptor.Key); Assert.Equal(typeof(string), descriptor.Type); Assert.Equal(ExecutionScope.Global, descriptor.Scope); Assert.Equal("foo", descriptor.Factory(null)); Assert.NotNull(descriptor.TriggerLoadAsync); }