public void WrongFileName()
 {
     try
     {
         new TemplateTile("name", new FileTemplate("somepath.htm"), null);
         Assert.Fail("Expected exception");
     }
     catch (TemplateException Te)
     {
         var expected = ResourceException.FileNotFound(Path.GetFullPath("somepath.htm"));
         Assert.That(
             Te.InnerException.Message,
             Is.EqualTo(expected.Message)
             );
         Assert.That(
             Te.Message,
             Is.EqualTo(TemplateException.TemplateFailedToInitialize(Path.GetFullPath("somepath.htm"), expected).Message));
     }
 }
        public void TestLastExceptionIsFilled()
        {
            var tempTile = Path.GetTempFileName();

            File.Copy("a.htm", tempTile, true);
            try
            {
                var ft = new FileTemplate(tempTile);
                Assert.That(ft.TileLastModified, Is.EqualTo(ft.ResourceLastModified));
                File.Delete(tempTile);
                Assert.That(ft.RefreshException, Is.Null);
                ft.Refresh();
                Assert.That(ft.RefreshException, Is.Not.Null);
                Assert.That(ft.RefreshException.Message, Is.EqualTo(TemplateException.TemplateFailedToInitialize(tempTile, ResourceException.FileNotFound(tempTile)).Message));
            }
            finally
            {
                File.Delete(tempTile);
            }
        }