public void ThrowsArgumentNullExceptionForNullPropertyExpressionArguments()
            {
                var propertyChangedEventArgs = new PropertyChangedEventArgs("TestProperty");

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => propertyChangedEventArgs.HasPropertyChanged((Expression <Func <string> >)null));
            }
Esempio n. 2
0
            public void SetPropertyValue_NotExistingProperty()
            {
                var myPropertyHelperClass = new MyPropertyHelperClass();

                ExceptionTester.CallMethodAndExpectException <PropertyNotFoundException>(() => PropertyHelper.SetPropertyValue(myPropertyHelperClass, "NotExistingProperty", 42));
            }
Esempio n. 3
0
 public void IsPropertyAvailable_NullInput()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => PropertyHelper.IsPropertyAvailable(null, "PublicProperty"));
 }
Esempio n. 4
0
            public void GetPropertyValue_PrivateReadProperty()
            {
                var myPropertyHelperClass = new MyPropertyHelperClass();

                ExceptionTester.CallMethodAndExpectException <CannotGetPropertyValueException>(() => PropertyHelper.GetPropertyValue(myPropertyHelperClass, "PrivateReadProperty"));
            }
Esempio n. 5
0
            public void TrySetPropertyValue_PropertyNameNull()
            {
                var obj = new MyPropertyHelperClass();

                ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => PropertyHelper.TrySetPropertyValue(obj, null, null));
            }
Esempio n. 6
0
            public void ThrowsArgumentNullExceptionForNullList()
            {
                int item = 2;

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => CollectionExtensions.MoveItemUp(null, item));
            }
Esempio n. 7
0
            public void ThrowsArgumentNullExceptionForNullType()
            {
                var serializationManager = new SerializationManager();

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => serializationManager.GetSerializerModifiers(null));
            }
Esempio n. 8
0
 public void ThrowsArgumentExceptionForNullString_WithStringAndType()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => new Log(null, typeof(object)));
 }
Esempio n. 9
0
 public void ThrowsArgumentExceptionForWhitespaceString_WithStringAndType()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => new Log(String.Empty, typeof(object)));
 }
Esempio n. 10
0
 public void ThrowsArgumentExceptionForNullString()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => new Log((string)null));
 }
Esempio n. 11
0
 public void ThrowsArgumentExceptionForWhitespaceString()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => new Log(String.Empty));
 }
Esempio n. 12
0
 public void ThrowsArgumentNullExceptionForNullType()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => new Log((Type)null));
 }
 public void ThrowsArgumentNullExceptionForNullInstance()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => new CollectionChangeUndo(null, CollectionChangeType.Add, 0, 0, null, null));
 }
Esempio n. 14
0
 public void ThrowsArgumentNullExceptionForNullType()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => new TypeRequestInfo(null));
 }
Esempio n. 15
0
 public void ThrowsArgumentNullExceptionForNullList()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => CollectionExtensions.MoveItemDownByIndex(null, 2));
 }
Esempio n. 16
0
 public void ThrowsArgumentNullExceptionForNullInstance()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => new ActionUndo(null, () => MockModel.Change("test")));
 }
Esempio n. 17
0
 public void ThrowsArgumentNullExceptionForNullList()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => CollectionExtensions.RemoveLast(null));
 }
Esempio n. 18
0
            public void ThrowsArgumentExceptionForNullUndoMethod()
            {
                var obj = new object();

                ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => new ActionUndo(obj, null));
            }
Esempio n. 19
0
            public void ThrowsArgumentNullExceptionForNullType()
            {
                var serializationManager = new SerializationManager();

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => serializationManager.GetRegularPropertyNames(null));
            }
Esempio n. 20
0
            public void ThrowsArgumentNullExceptionForNullPropertyInfo()
            {
                ObsoleteAttribute attribute;

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => ((MemberInfo)null).TryGetAttribute(out attribute));
            }
Esempio n. 21
0
            public void ThrowsArgumentNullExceptionForNullType()
            {
                var serializationManager = new SerializationManager();

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => serializationManager.GetCatelPropertiesToSerialize(null));
            }
Esempio n. 22
0
 public void ThrowsArgumentNullExceptionForNullAndEmptyTypeRequestInfos()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => new TypeRequestPath((TypeRequestInfo)null));
     ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => new TypeRequestPath((TypeRequestInfo[])null));
     ExceptionTester.CallMethodAndExpectException <ArgumentException>(() => new TypeRequestPath(new TypeRequestInfo[] { }));
 }
Esempio n. 23
0
 public void TrySetPropertyValue_ObjectNull()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => PropertyHelper.TrySetPropertyValue(null, "property", null));
 }
Esempio n. 24
0
 public void ThrowsArgumentNullExceptionForExceptionTypeNullParameter()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => new ExceptionHandler(null, exception => { }));
 }
Esempio n. 25
0
 public void SetPropertyValue_NullInput()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => PropertyHelper.SetPropertyValue(null, "PublicProperty", 42));
 }
Esempio n. 26
0
 public void ThrowsArgumentNullExceptionForActionNullParameter()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => new ExceptionHandler(typeof(Exception), null));
 }
Esempio n. 27
0
            public void SetPropertyValue_PrivateWriteProperty()
            {
                var myPropertyHelperClass = new MyPropertyHelperClass();

                ExceptionTester.CallMethodAndExpectException <CannotSetPropertyValueException>(() => PropertyHelper.SetPropertyValue(myPropertyHelperClass, "PrivateWriteProperty", 42));
            }
Esempio n. 28
0
            public void ThrowsArgumentNullExceptionForHandleNullParameter()
            {
                var handler = new ExceptionHandler(typeof(Exception), exception => { });

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => handler.Handle(null));
            }
Esempio n. 29
0
            public void ThrowsArgumentNullExceptionForNullCommand()
            {
                var compositeCommand = new CompositeCommand();

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => compositeCommand.UnregisterCommand(null));
            }
 public void ThrowsArgumentNullExceptionForNullPropertyChangedArguments()
 {
     ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => PropertyChangedEventArgsExtensions.HasPropertyChanged(null, () => TestProperty));
 }