Exemple #1
0
        public async Task LoadForms_should_support_no_forms()
        {
            var text   = "<Forms/>";
            var loader = new FormLoader();

            Assert.Empty(await loader.LoadForms(new StringReader(text)));
        }
Exemple #2
0
        public async Task LoadForms_should_throw_meaningful_exception_if_cannot_parse_forms_element()
        {
            var text   = "<Something/>";
            var loader = new FormLoader();
            var ex     = await Assert.ThrowsAsync <InvalidOperationException>(() => loader.LoadForms(new StringReader(text)));

            ex.Message.ShouldBe("Expected 'Forms' element, but got 'Something'");
        }