Exemplo n.º 1
0
        public void FileSystemProvider_CanFindExistingResource()
        {
            var provider = new FileSystemResourceProvider("Templates");
            var resource = provider.Get("Template.tmpl");

            Assert.IsNotNull(resource);
            Assert.IsTrue(resource.Length > 0);
        }
Exemplo n.º 2
0
        public void FileSystemProvider_CanFindLocalizedResource()
        {
            var provider = new FileSystemResourceProvider("Templates");
            var resource = provider.Get("Template.tmpl", new CultureInfo("ru-RU"));

            Assert.IsNotNull(resource);
            using (var streamReader = new StreamReader(resource))
            {
                var templateString = streamReader.ReadToEnd();
                Assert.IsTrue(templateString.Contains("русском"));
            }
        }
Exemplo n.º 3
0
        public void FileSystemProvider_ThrowsResourceNotFoundException_WhenResourceIsNotFound()
        {
            var provider = new FileSystemResourceProvider("Templates");

            var resource = provider.Get("TemplateNotFound.tmpl", new CultureInfo("en"));
        }