public void TestRegisterAndResolveWithDependancies() { IContainer container = new Container() .Register <IFileSystemAdapter>(c => new FileSystemAdapter()) .Register <IBuildDirectoryStructureService, BuildDirectoryStructureService>() .Register <ISimpleClassNoDependancies>(new SimpleClassNoDependancies()); IBuildDirectoryStructureService service = container.Resolve <IBuildDirectoryStructureService>(); Assert.IsNotNull(service); Assert.IsNotNull(service.FileSystemAdapter); }
public static void Test() { IoC.Register <IFileSystemAdapter, FileSystemAdapter>(); IoC.Register <IBuildDirectoryStructureService, BuildDirectoryStructureService>(); IBuildDirectoryStructureService service = IoC.Resolve <IBuildDirectoryStructureService>(); }