public void TestCanLoadAllTypesFromAssemblies()
        {
            // If this test fails, failing assemblies must be added to the Stencil.BlackListedAssemblies
            Assert.DoesNotThrow(() =>
            {
                var stencil = new TestStencil();
                var types   = stencil.GetAssemblies()
                              .SelectMany(a => a.GetTypesSafe(), (domainAssembly, assemblyType) => assemblyType)
                              .Where(t => !t.IsAbstract && !t.IsInterface);
                Assert.IsNotNull(types);
            });

            LogAssert.NoUnexpectedReceived();
        }
Esempio n. 2
0
 static void DataWatchServiceDisableThrottling(bool value)
 {
     try
     {
         var stencil = new TestStencil();
         var dataWatchServiceType = stencil.GetAssemblies()
                                    .SelectMany(a => a.GetTypesSafe(), (domainAssembly, assemblyType) => assemblyType)
                                    .First(x => x.Name == "DataWatchService");
         var sharedInstance = dataWatchServiceType.GetProperty("sharedInstance", BindingFlags.NonPublic | BindingFlags.Static)?.GetValue(null);
         dataWatchServiceType.GetProperty("disableThrottling", BindingFlags.NonPublic | BindingFlags.Static)?.SetValue(sharedInstance, value);
     }
     catch
     {
         Debug.LogWarning("DataWatchServiceDisableThrottling failed");
     }
 }