public void RegisterSingleton_NotImplementClass_ThrowExeption() { // Arrange ioc.Setup(i => i.RegisterSingleton <IBase>(It.IsAny <Sub>())).Throws <IOCException>(); // Act Labo.RegisterSingleton <IBase>(new Sub()); }
public void RegisterSingleton_IBaseWithBase_Success() { // Arrange var value = new Base(); // Act Labo.RegisterSingleton <IBase>(value); // Assert ioc.Verify(i => i.RegisterSingleton <IBase>(value)); }
void SetRepository(string keyValuePairsFilePath) { var configurtion = Labo.Resolve <IConfigurationSettings>(); IFormatKeyValuePairsRepository repository = null; if (configurtion.IsXmlMode) { repository = new FormatKeyValuePairsXmlRepository(keyValuePairsFilePath); } else { repository = new FormatKeyValuePairsRepository(keyValuePairsFilePath, Labo.Resolve <FormacchanLibrary.Services.IFormatKeyValuePairsService>(), configurtion); } Labo.RegisterSingleton <IFormatKeyValuePairsRepository>(repository); }
void RegisterSingleton() { Labo.RegisterSingleton <ICountersRepository>(new CountersTemporarilyRepository()); Labo.RegisterSingleton <IMessenger>(new MessageHub(Labo.Resolve <IPostsService>())); }
void SetInterfaceImplement() { Labo.RegisterSingleton <ICounterRepository>(new CounterRepository()); Labo.Register <ICounterService, CounterService>(); }
private void RegisterSingleton(string keyValuePairsFilePath) { Labo.RegisterSingleton <IConfigurationSettings>(new ConfigurationSettingFromConfigFile()); SetRepository(keyValuePairsFilePath); }