Beispiel #1
0
        public void CreateDictionaryInstance_Return_Valid_Result()
        {
            Dictionary <string, Exception> obj = null;

            Assert.That(() => obj = ClassUtil.CreateDictionaryInstance <string, Exception>(), Throws.Nothing);
            Assert.That(obj, Is.Not.Null);
            Assert.That(obj, Is.TypeOf <Dictionary <string, Exception> >());
        }
Beispiel #2
0
        public void CreateDictionaryInstance_By_Type_Return_Valid_Result()
        {
            Type keyType      = typeof(string);
            Type valueType    = typeof(Exception);
            Type expectedType = typeof(Dictionary <string, Exception>);
            Dictionary <string, Exception> obj = null;

            Assert.That(() => obj = (Dictionary <string, Exception>)ClassUtil.CreateDictionaryInstance(keyType, valueType), Throws.Nothing);
            Assert.That(obj, Is.Not.Null);
            Assert.That(obj, Is.TypeOf(expectedType));
        }
Beispiel #3
0
 public void CreateDictionaryInstance_Throws_ArgumentNullException(Type keyType, Type valueType, string expectedParameter)
 {
     AssertThrowsException <ArgumentNullException>(() => ClassUtil.CreateDictionaryInstance(keyType, valueType), expectedParameter);
 }