public void Should_generate_new_guid() { InfrastructureDependencyRegistrar.RegisterInfrastructure(); var generator = ObjectFactory.GetInstance <IGuidGenerator>(); generator.CreateGuid(); }
public void Correctly_Constructs_Instance_With_Key() { InfrastructureDependencyRegistrar.RegisterInfrastructure(); IServiceLocator serviceLocator = new ServiceLocator(); var instance = serviceLocator.CreateInstance <IDatabaseActionExecutor>("Create"); Assert.That(instance, Is.Not.Null); }
public void Correctly_Constructs_Instance() { InfrastructureDependencyRegistrar.RegisterInfrastructure(); IServiceLocator serviceLocator = new ServiceLocator(); var instance = serviceLocator.CreateInstance <IResourceFileLocator>(); Assert.That(instance, Is.Not.Null); }
public void Init(System.Web.HttpApplication context) { InfrastructureDependencyRegistrar.RegisterInfrastructure(); _context = context; _context.PreRequestHandlerExecute += PreRequestHandlerExecute; _context.BeginRequest += BeginRequest; _context.AuthenticateRequest += AuthenticateRequest; _context.AcquireRequestState += AcquireRequestState; Initialized(); }
protected override void ExecuteTask() { try { InfrastructureDependencyRegistrar.RegisterInfrastructure(); var importer = new ServiceLocator().CreateInstance <IExcelImporter>(); importer.Import(ExcelFile.FullName, Server, Database, IntegratedAuthentication, Username, Password, this); } catch { if (FailOnError) { throw; } } }
public void Correctly_Reads_Excel_File() { InfrastructureDependencyRegistrar.RegisterInfrastructure(); IResourceFileLocator fileLocator = ObjectFactory.GetInstance <IResourceFileLocator>(); byte[] excelFileBytes = fileLocator.ReadBinaryFile(_testAssembly, string.Format(_resourceTemplate, "Sample.xls")); IExcelWorkbookReader reader = new ExcelWorkbookReader(); DataSet workbook = reader.GetWorkbookData(new MemoryStream(excelFileBytes)); Assert.That(workbook, Is.Not.Null); Assert.That(workbook.Tables.Count, Is.EqualTo(1)); Assert.That(workbook.Tables["Sample Data"], Is.Not.Null); Assert.That(workbook.Tables["Sample Data"].Columns.Count, Is.EqualTo(3)); Assert.That(workbook.Tables["Sample Data"].Rows.Count, Is.EqualTo(6)); }
public void Setup() { InfrastructureDependencyRegistrar.RegisterInfrastructure(); // DatabaseManager.Core.InfrastructureDependencyRegistrar.RegisterInfrastructure(); }
public virtual void SetUp() { InfrastructureDependencyRegistrar.RegisterInfrastructure(); ClearTables(); SetupDatabase(); }