public void Initialize() { _mockRepository.ReplayAll(); WebDesginModeHelper webDesginModeHelper = new WebDesginModeHelper(_mockDesignerHost); _mockRepository.VerifyAll(); Assert.That(webDesginModeHelper.DesignerHost, Is.SameAs(_mockDesignerHost)); }
public void GetConfiguration() { System.Configuration.Configuration expected = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); Expect.Call(_mockDesignerHost.GetService(typeof(IWebApplication))).Return(_mockWebApplication); Expect.Call(_mockWebApplication.OpenWebConfiguration(true)).Return(expected); _mockRepository.ReplayAll(); WebDesginModeHelper webDesginModeHelper = new WebDesginModeHelper(_mockDesignerHost); System.Configuration.Configuration actual = webDesginModeHelper.GetConfiguration(); _mockRepository.VerifyAll(); Assert.That(actual, Is.SameAs(expected)); }
public void GetProjectPath() { IProjectItem mockProjectItem = _mockRepository.StrictMock <IProjectItem>(); Expect.Call(_mockDesignerHost.GetService(typeof(IWebApplication))).Return(_mockWebApplication); SetupResult.For(_mockWebApplication.RootProjectItem).Return(mockProjectItem); Expect.Call(mockProjectItem.PhysicalPath).Return("TheProjectPath"); _mockRepository.ReplayAll(); WebDesginModeHelper webDesginModeHelper = new WebDesginModeHelper(_mockDesignerHost); string actual = webDesginModeHelper.GetProjectPath(); _mockRepository.VerifyAll(); Assert.That(actual, Is.EqualTo("TheProjectPath")); }