Exemple #1
0
        public async Task Ensure_TemplateKey_IsNormalizedAsync()
        {
            var project = new FileSystemRazorProject(DirectoryUtils.RootDirectory);

            string templateKey = "Empty";

            var item = await project.GetItemAsync(Path.Combine("Assets", "Embedded", templateKey));

            Assert.NotNull(item);
            Assert.EndsWith(templateKey + project.Extension, item.Key);
        }
        public async Task Ensure_GetKnownKeysAsync_Returns_Existing_Keys()
        {
            var project = new FileSystemRazorProject(DirectoryUtils.RootDirectory.ToLowerInvariant());

            var knownKeys = await project.GetKnownKeysAsync();

            Assert.NotNull(knownKeys);
            Assert.NotEmpty(knownKeys);

            foreach (var key in knownKeys)
            {
                var projectItem = await project.GetItemAsync(key);

                Assert.True(projectItem.Exists);
            }
        }
Exemple #3
0
        public void Null_TemplateKey_ThrowsOn_GetItem()
        {
            var project = new FileSystemRazorProject(DirectoryUtils.RootDirectory);

            Assert.ThrowsAsync <ArgumentNullException>(async() => await project.GetItemAsync("not-existing-key"));
        }