public void RegisterModule_ThrowsDuplicateRegistryException_OnSameNameRegister() { MockModule secondMockModule = new MockModule(); moduleRegistry.RegisterModule(mockModule); Assert.Throws <DuplicateRegistryException>(() => moduleRegistry.RegisterModule(secondMockModule)); }
public void InitialiseCalledOnModule() { var module = new MockModule(); var loader = new ModuleLoader(_ => module); loader.Add(typeof(object)); loader.Initialize(); Assert.True(module.InitializeCalled); }
public void InitialiseTypePassedToCreator() { var module = new MockModule(); Type type = null; IModule Action(Type x) { type = x; return(module); } var loader = new ModuleLoader(Action); loader.Add(typeof(object)); loader.Initialize(); Assert.Equal(typeof(object), type); }
public void SetUp() { mockModule = new MockModule(); moduleRegistry = Bot.CreateOrGet().ModuleRegistry; }