public void Constructor_WhenTreeServiceCurrentTreeIsNull_SetsCurrentTreeToNull() { var projectTreeService = new Lazy <IProjectTreeService>(() => IProjectTreeServiceFactory.ImplementCurrentTree(() => null)); var projectTreeProvider = new Lazy <IProjectTreeProvider>(() => IProjectTreeProviderFactory.Create()); var projectTree = new PhysicalProjectTree(projectTreeService, projectTreeProvider); Assert.Null(projectTree.CurrentTree); }
public void Constructor_ValueAsTreeProvider_SetTreeProviderProperty() { var projectTreeService = new Lazy <IProjectTreeService>(() => IProjectTreeServiceFactory.Create()); var projectTreeProvider = new Lazy <IProjectTreeProvider>(() => IProjectTreeProviderFactory.Create()); var projectTree = new PhysicalProjectTree(projectTreeService, projectTreeProvider); Assert.Same(projectTreeProvider.Value, projectTree.TreeProvider); }
public void Constructor_ValueAsTreeService_SetsCurrentTreeToTreeServiceCurrentTreeTree() { var tree = ProjectTreeParser.Parse(@" Root (flags: {ProjectRoot}) "); var projectTreeServiceState = IProjectTreeServiceStateFactory.ImplementTree(() => tree); var projectTreeService = new Lazy <IProjectTreeService>(() => IProjectTreeServiceFactory.ImplementCurrentTree(() => projectTreeServiceState)); var projectTreeProvider = new Lazy <IProjectTreeProvider>(() => IProjectTreeProviderFactory.Create()); var projectTree = new PhysicalProjectTree(projectTreeService, projectTreeProvider); Assert.Same(tree, projectTree.CurrentTree); }