public GetSitecoreConfig ( ) : ServerResponse |
||
Résultat | ServerResponse |
public void GetSitecoreConfigClientUrlHostNotFound() { var mockCxSettings = new Mock<ISitecoreConnectionSettings>(); mockCxSettings.SetupGet(cxSettings => cxSettings.ClientUrl).Returns("http://localhost/sitecore"); var manager = new SitecoreConnectionManager(mockCxSettings.Object); var response = manager.GetSitecoreConfig(); Assert.IsNotNull(response); Assert.IsNull(response.Data); Assert.IsNotNull(response.GetExceptions()); Assert.IsTrue(response.GetExceptions().Any(ex => ex.GetType() == typeof(WebException))); }
public void GetSitecoreConfigPasswordMissing() { var mockCxSettings = new Mock<ISitecoreConnectionSettings>(); mockCxSettings.SetupGet(cxSettings => cxSettings.Username).Returns(@"sitecore\admin"); mockCxSettings.SetupGet(cxSettings => cxSettings.Password).Returns((string)null); mockCxSettings.SetupGet(cxSettings => cxSettings.ClientUrl).Returns("http://sc80/sitecore"); var manager = new SitecoreConnectionManager(mockCxSettings.Object); var response = manager.GetSitecoreConfig(); Assert.IsNotNull(response); Assert.IsNull(response.Data); Assert.IsNotNull(response.GetExceptions()); Assert.IsTrue(response.GetExceptions().Any(ex => ex.GetType() == typeof(AuthenticationException))); }
public void GetSitecoreConfigSitecore80() { var mockCxSettings = new Mock<ISitecoreConnectionSettings>(); mockCxSettings.SetupGet(cxSettings => cxSettings.Username).Returns(@"sitecore\admin"); mockCxSettings.SetupGet(cxSettings => cxSettings.Password).Returns("b"); mockCxSettings.SetupGet(cxSettings => cxSettings.ClientUrl).Returns("http://sc80/sitecore"); var manager = new SitecoreConnectionManager(mockCxSettings.Object); var response = manager.GetSitecoreConfig(); Assert.IsNotNull(response); Assert.IsNotNull(response.Data); Assert.IsNotNull(response.GetExceptions()); Assert.IsFalse(response.GetExceptions().Any()); }