public void Resolve_Parser_Not_Found() { // arrange var dummy = new DummyResultParser(); var dict = new Dictionary<Type, IResultParser> { { dummy.ResultType, dummy } }; var resolver = new ResultParserCollection(dict); // act Action action = () => resolver.Get(typeof(int)); // assert Assert.Throws<ArgumentException>(action); }
public void Resolve_Type_Is_Null() { // arrange var dummy = new DummyResultParser(); var dict = new Dictionary<Type, IResultParser> { { dummy.ResultType, dummy } }; var resolver = new ResultParserCollection(dict); // act Action action = () => resolver.Get(null); // assert Assert.Throws<ArgumentNullException>(action); }
public void Resolve_Parser() { // arrange var dummy = new DummyResultParser(); var dict = new Dictionary<Type, IResultParser> { { dummy.ResultType, dummy } }; var resolver = new ResultParserCollection(dict); // act IResultParser parser = resolver.Get(typeof(string)); // assert Assert.NotNull(parser); Assert.IsType<DummyResultParser>(parser); }