private void Observabler() { ObservedClass obs = new ObservedClass(); NotifiedClass n1 = new NotifiedClass(); NotifiedClass n2 = new NotifiedClass(); obs.Attach(n1); obs.Attach(n1); }
public void NoExceptionThrownWhenPropertyChanged() { NotifiedClass obj = new NotifiedClass(); Exception ex = Record.Exception( () => Assert.PropertyChanged(obj, "Property1", () => obj.Property1 = "NewValue") ); Assert.Null(ex); }
public void NoExceptionThrownWhenPropertyChanged() { var obj = new NotifiedClass(); var ex = Record.Exception( () => Assert.PropertyChanged(obj, "Property1", () => obj.Property1 = "NewValue") ); Assert.Null(ex); }
public async void NoExceptionThrownWhenPropertyChangedAsync() { var obj = new NotifiedClass(); var ex = await Record.ExceptionAsync( () => Assert.PropertyChangedAsync(obj, "Property1", async() => obj.Property1 = "NewValue") ); Assert.Null(ex); }
public void ExceptionThrownWhenPropertyNotChanged(string expectedValue) { var obj = new NotifiedClass(); var ex = Record.Exception( () => Assert.PropertyChanged(obj, "Property1", () => { }, expectedValue) ); Assert.IsType<PropertyChangedException>(ex); Assert.Equal("Assert.PropertyChanged failure: Property Property1 was not set", ex.Message); }
public void ExceptionThrownWhenPropertyNotChanged() { NotifiedClass obj = new NotifiedClass(); Exception ex = Record.Exception( () => Assert.PropertyChanged(obj, "Property1", () => { }) ); Assert.IsType<PropertyChangedException>(ex); Assert.Equal("Assert.PropertyChanged failure: Property Property1 was not set", ex.Message); }
public void ExceptionThrownWhenWrongPropertyChanged() { var obj = new NotifiedClass(); var ex = Record.Exception( () => Assert.PropertyChanged(obj, "Property1", () => obj.Property2 = 42) ); Assert.IsType<PropertyChangedException>(ex); Assert.Equal("Assert.PropertyChanged failure: Property Property1 was not set", ex.Message); }
public void ExceptionThrownWhenWrongPropertyChanged() { NotifiedClass obj = new NotifiedClass(); Exception ex = Record.Exception( () => Assert.PropertyChanged(obj, "Property1", () => obj.Property2 = 42) ); Assert.IsType <PropertyChangedException>(ex); Assert.Equal("Assert.PropertyChanged failure: Property Property1 was not set", ex.Message); }
public async void ExceptionThrownWhenPropertyNotChanged() { var obj = new NotifiedClass(); var ex = await Record.ExceptionAsync( () => Assert.PropertyChangedAsync(obj, "Property1", async() => { }) ); Assert.IsType <PropertyChangedException>(ex); Assert.Equal("Assert.PropertyChanged failure: Property Property1 was not set", ex.Message); }
public async void NoExceptionThrownWhenMultiplePropertyChangesIncludesCorrectProperty() { var obj = new NotifiedClass(); var ex = await Record.ExceptionAsync( () => Assert.PropertyChangedAsync(obj, "Property1", async() => { obj.Property2 = 12; obj.Property1 = "New Value"; obj.Property2 = 42; }) ); Assert.Null(ex); }
public void NoExceptionThrownWhenMultiplePropertyChangesIncludesCorrectProperty() { var obj = new NotifiedClass(); var ex = Record.Exception( () => { Assert.PropertyChanged(obj, "Property1", () => { obj.Property2 = 12; obj.Property1 = "New Value"; obj.Property2 = 42; }); } ); Assert.Null(ex); }
public void NoExceptionThrownWhenMultiplePropertyChangesIncludesCorrectProperty() { NotifiedClass obj = new NotifiedClass(); Exception ex = Record.Exception( () => { Assert.PropertyChanged(obj, "Property1", () => { obj.Property2 = 12; obj.Property1 = "New Value"; obj.Property2 = 42; }); } ); Assert.Null(ex); }
public async void ExceptionThrownWhenPropertyNotChanged() { var obj = new NotifiedClass(); var ex = await Record.ExceptionAsync( () => Assert.PropertyChangedAsync(obj, "Property1", async () => { }) ); Assert.IsType<PropertyChangedException>(ex); Assert.Equal("Assert.PropertyChanged failure: Property Property1 was not set", ex.Message); }
public async void NoExceptionThrownWhenMultiplePropertyChangesIncludesCorrectProperty(string expectedValue) { var obj = new NotifiedClass(); var ex = await Record.ExceptionAsync( () => Assert.PropertyChangedAsync(obj, "Property1", async () => { obj.Property2 = 12; obj.Property1 = "New Value"; obj.Property2 = 42; }, expectedValue) ); Assert.Null(ex); }
public async void NoExceptionThrownWhenPropertyChangedAsync() { var obj = new NotifiedClass(); var ex = await Record.ExceptionAsync( () => Assert.PropertyChangedAsync(obj, "Property1", async () => obj.Property1 = "NewValue") ); Assert.Null(ex); }
public void ExceptionThrownWhenPropertyChangedToUnexpectedValue() { var obj = new NotifiedClass(); var ex = Record.Exception( () => Assert.PropertyChanged(obj, "Property1", () => obj.Property1 = "Unexpected Value", "Expected Value")); Assert.IsType<PropertyChangedException>(ex); Assert.Equal("Assert.PropertyChanged failure: Property Property1 was not set to expected value Expected Value", ex.Message); }
public async void ExceptionThrownWhenWrongPropertyChangedAsync(string expectedValue) { var obj = new NotifiedClass(); var ex = await Record.ExceptionAsync( () => Assert.PropertyChangedAsync(obj, "Property1", async () => obj.Property2 = 42, expectedValue) ); Assert.IsType<PropertyChangedException>(ex); Assert.Equal("Assert.PropertyChanged failure: Property Property1 was not set", ex.Message); }