Exemplo n.º 1
0
        public void op_Content_DateTime_AbsoluteUri()
        {
            var date = DateTime.UtcNow;

            var xml = new XmlDocument();

            xml.LoadXml(RedirectionResult.Content(date, "http://example.com/"));

            var navigator = xml.CreateNavigator();

            Assert.True(navigator.Evaluate <bool>("1 = count(/html/head/meta[@value='{0}'])".FormatWith(date.ToXmlString())));
            Assert.True(navigator.Evaluate <bool>("1 = count(//a[@id='location'][@href='{0}'])".FormatWith("http://example.com/")));
            Assert.True(navigator.Evaluate <bool>("1 = count(//a[@id='location'][text()='{0}'])".FormatWith("http://example.com/")));
        }
Exemplo n.º 2
0
 public void op_Content_DateTime_AbsoluteUriNull()
 {
     Assert.Throws <ArgumentNullException>(() => RedirectionResult.Content(DateTime.UtcNow, null));
 }