Beispiel #1
0
        public void Resolve_Parser_Not_Found()
        {
            // arrange
            var resolver = new ResultParserResolver(new[] { new DummyResultParser() });

            // act
            Action action = () => resolver.GetResultParser(typeof(int));

            // assert
            Assert.Throws <ArgumentException>(action);
        }
Beispiel #2
0
        public void Resolve_Type_Is_Null()
        {
            // arrange
            var resolver = new ResultParserResolver(new[] { new DummyResultParser() });

            // act
            Action action = () => resolver.GetResultParser(null);

            // assert
            Assert.Throws <ArgumentNullException>(action);
        }
Beispiel #3
0
        public void Resolve_Parser()
        {
            // arrange
            var resolver = new ResultParserResolver(new[] { new DummyResultParser() });

            // act
            IResultParser parser = resolver.GetResultParser(typeof(string));

            // assert
            Assert.NotNull(parser);
            Assert.IsType <DummyResultParser>(parser);
        }