public void GetListInValidMachineNameReturnsEmptyList() { // Mock the request object now HttpContextFactory.SetCurrentContext(GetMockedHttpContext()); XmlsDataFactory.SetXmlData(GetXmlData()); var sb = new SupportedBrowser(); var l = sb.GetList("Wrong Data"); Assert.IsTrue(l.Count == 0); }
public void GetMessageSupportedStatusReturnsEmptyString() { // Mock the request object now HttpContextFactory.SetCurrentContext(GetMockedHttpContext()); XmlsDataFactory.SetXmlData(GetXmlData()); var sb = new SupportedBrowser { SupportStatus = SupportedBrowser.SupportStatusEnum.Supported }; var message = sb.GetMessage(); Assert.IsTrue(string.IsNullOrWhiteSpace(message)); }
public void VerifySupportedBrowserVersion() { // Mock the request object now var requestContext = new Mock <RequestContext>(); var context = new Mock <HttpContextBase>(); var request = new Mock <HttpRequestBase>(); requestContext.Setup(x => x.HttpContext).Returns(context.Object); requestContext.Setup(x => x.HttpContext).Returns(context.Object); context.Setup(ctx => ctx.Request).Returns(request.Object); context.Setup(ctx => ctx.Request.Browser).Returns(request.Object.Browser); context.Setup(ctx => ctx.Request.UserAgent).Returns("WINDOWS"); context.Setup(ctx => ctx.Request.Browser.Version).Returns("9.0"); context.Setup(ctx => ctx.Request.Browser.Browser).Returns("IE"); HttpContextFactory.SetCurrentContext(context.Object); XmlsDataFactory.SetXmlData(GetXmlData()); var sb = new SupportedBrowser(); Assert.IsTrue(sb.SupportStatus == SupportedBrowser.SupportStatusEnum.Supported); }