public void DefaultTypeForOpenTypeTrigger() { var ext = new OpenTypeTriggerExtension(); var prog = new FakeTypeLocator(); JobHostConfiguration config = TestHelpers.NewConfig(prog, ext); var host = new JobHost(config); IJobHostMetadataProvider metadataProvider = host.CreateMetadataProvider(); var attr = new Test9Attribute(null); var type = metadataProvider.GetDefaultType(attr, FileAccess.Write, null); // The trigger handles Open type, which means it will first pull byte[]. Assert.Equal(typeof(byte[]), type); }
public void DefaultTypeForOpenTypeTrigger() { var ext = new OpenTypeTriggerExtension(); var host = new HostBuilder() .ConfigureDefaultTestHost(b => { b.AddExtension(ext); }) .ConfigureTypeLocator() // empty .Build(); IJobHostMetadataProvider metadataProvider = host.CreateMetadataProvider(); var attr = new Test9Attribute(null); var type = metadataProvider.GetDefaultType(attr, FileAccess.Write, null); // The trigger handles Open type, which means it will first pull byte[]. Assert.Equal(typeof(byte[]), type); }