public void ParseBinderConfigurations_ReturnsBinder()
 {
     var result = new Dictionary<string, IBinderType>();
     DefaultBinderTypeRegistry.AddBinderTypes(AppDomain.CurrentDomain.GetAssemblies(), result);
     Assert.Single(result);
     Assert.Equal("Steeltoe.Stream.TestBinder.Startup, Steeltoe.Stream.TestBinder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", result["testbinder"].ConfigureClass);
 }
 public void AddBinderTypes_WithValidDirectory_ReturnsBinder()
 {
     var result = new Dictionary<string, IBinderType>();
     DefaultBinderTypeRegistry.AddBinderTypes(Environment.CurrentDirectory, result);
     Assert.Single(result);
     Assert.Equal("Steeltoe.Stream.TestBinder.Startup, Steeltoe.Stream.TestBinder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", result["testbinder"].ConfigureClass);
 }
        public void AddBinderTypes_WithInValidDirectory_ReturnsBinder()
        {
            var result = new Dictionary <string, IBinderType>();

            DefaultBinderTypeRegistry.AddBinderTypes(Path.GetTempPath(), result);
            Assert.Empty(result);
        }
Esempio n. 4
0
        public void AddBinderTypes_WithValidDirectory_ReturnsBinder()
        {
            var binderDir = GetSearchDirectories("TestBinder")[0];
            var result    = new Dictionary <string, IBinderType>();

            DefaultBinderTypeRegistry.AddBinderTypes(binderDir, result);
            Assert.Single(result);
            Assert.Matches(@"Steeltoe.Stream.TestBinder.Startup, Steeltoe.Stream.TestBinder, Version=[\d.]+, Culture=neutral, PublicKeyToken=null", result["testbinder"].ConfigureClass);
        }
Esempio n. 5
0
        public void AddBinderTypes_WithBinderAllreadyLoaded_ReturnsBinder()
        {
            var paths = BuildPaths(null);

            var result     = new Dictionary <string, IBinderType>();
            var binderPath = GetSearchDirectories("TestBinder")[0] + Path.DirectorySeparatorChar + "Steeltoe.Stream.TestBinder.dll";

            Assembly.LoadFrom(binderPath);

            DefaultBinderTypeRegistry.AddBinderTypes(AppDomain.CurrentDomain.GetAssemblies(), result);

            Assert.Single(result, r => r.Key == "testbinder");
            Assert.Matches(@"Steeltoe.Stream.TestBinder.Startup, Steeltoe.Stream.TestBinder, Version=[\d.]+, Culture=neutral, PublicKeyToken=null", result["testbinder"].ConfigureClass);
        }