public void WhenIsCalledTwiceItWillReturnSameInstance()
        {
            var window = new StubIWindow
            {
                IsLoadedGet = () => true
            };
            var windowFactory = new StubIWindowFactory { CreateStringUIElement = (s, element) => window };
            var itemEditorWindowFactory = new ItemEditorWindowFactory(new StubIItemEditorClosingHandler(), windowFactory, new StubIItemEditorView());

            Assert.AreEqual(window, itemEditorWindowFactory.Create());
            Assert.AreEqual(window, itemEditorWindowFactory.Create());
        }
        public void CreateWillCallWindowFactory()
        {
            var window = new StubIWindow();
            var windowFactory = new StubIWindowFactory
            {
                CreateStringUIElement = (s, element) => window
            };

            var instance = new ItemEditorWindowFactory(new StubIItemEditorClosingHandler(), windowFactory,
                new StubIItemEditorView());

            Assert.AreEqual(window, instance.Create());
        }
        public void CreateWillBuildNewWindow()
        {
            var element = new UIElement();
            var itemEditorView = new StubIItemEditorView
            {
                ControlGet = () => element
            };
            var windowFactory = new StubIWindowFactory
            {
                CreateStringUIElement = (windowTitle, control) =>
                {
                    Assert.AreEqual(Resources.ProjectExplorerItemName, windowTitle);
                    Assert.AreEqual(element, control);

                    return new StubIWindow();
                }
            };

            var itemEditorWindowFactory = new ItemEditorWindowFactory(new StubIItemEditorClosingHandler(), windowFactory, itemEditorView);

            itemEditorWindowFactory.Create();
        }