public void Open_ResourceExists_ReturnsContents()
        {
            var resolver = new EmbeddedResourceResolver();
            var result =
                resolver.Open(
                    new PathDefinition
                        {
                            IsWildcard = true, 
                            VirtualPath = "~/Test/", 
                            ResourceLocation = Assembly.GetExecutingAssembly().CodeBase
                        }, 
                    "~/Test/Resources/Designer.cshtml");

            string resultString;
            using (var sr = new StreamReader(result))
            {
                resultString = sr.ReadToEnd();
            }

            Assert.AreEqual(@"@model string
@{
    ViewBag.Title = ""DesignerView"";
}

My Content", resultString, "The content of the file is not as expected.");
        }
        public void Exists_ResourceExists_ReturnsTrue()
        {
            var resolver = new EmbeddedResourceResolver();
            var result = resolver.Exists(new PathDefinition()
            {
                IsWildcard = true,
                VirtualPath = "~/Test/",
                ResourceLocation = Assembly.GetExecutingAssembly().CodeBase
            }, "~/Test/Resources/Master.Designer.cshtml");

            Assert.IsTrue(result);
        }
        public void Exists_ResourceExists_ReturnsTrue()
        {
            var resolver = new EmbeddedResourceResolver();
            var result =
                resolver.Exists(
                    new PathDefinition
                        {
                            IsWildcard = true, 
                            VirtualPath = "~/Test/", 
                            ResourceLocation = Assembly.GetExecutingAssembly().CodeBase
                        }, 
                    "~/Test/Resources/Designer.cshtml");

            Assert.IsTrue(result, "The method returns that resource doesn't exist when it does.");
        }
        public void Exists_ResourceDoesNotExist_ReturnsFalse()
        {
            //Arrange
            var resolver = new EmbeddedResourceResolver();

            //Act
            var result = resolver.Exists(new PathDefinition()
            {
                IsWildcard = true,
                VirtualPath = "~/Test/",
                ResourceLocation = Assembly.GetExecutingAssembly().CodeBase
            }, "~/Test/Resources/Imaginary/Master.Designer.cshtml");

            //Assert
            Assert.IsFalse(result, "The method returns that resource exist when it doesn't.");
        }