Beispiel #1
0
        public async void FileNotConfiguredThrowsKnowledgebaseException()
        {
            var source = new FileSource(TestFiles.TocFileOnly, Substitute.For <ILogger>());

            var ex = await Assert.ThrowsAsync <KnowledgebaseException>(() => source.GetKnowledgebaseXml(KnowedgebaseSubjects.Incidents, CancellationToken.None));

            Assert.Equal("Incidents file not configured", ex.Message);
        }
Beispiel #2
0
        public async void FileNotExistsThrowsKnowledgebaseException()
        {
            var source = new FileSource(new Dictionary <KnowedgebaseSubjects, string>()
            {
                { KnowedgebaseSubjects.Tocs, "Invalid.xml" },
            }, Substitute.For <ILogger>());

            var ex = await Assert.ThrowsAsync <KnowledgebaseException>(() => source.GetKnowledgebaseXml(KnowedgebaseSubjects.Tocs, CancellationToken.None));

            Assert.Equal("Tocs file does not exist: Invalid.xml", ex.Message);
        }