コード例 #1
0
        public void SettingFacadeIntPropertyUpdatesDependencyIntProperty()
        {
            var expectedResult = 999;
            var facade         = new FacadeModel(new BaseModel());

            facade.IntProperty = expectedResult;

            Assert.Equal(expectedResult, facade.Dependency.IntProperty);
        }
コード例 #2
0
        public void SettingAnotherStringPropertyUpdatesTheDependencyStringProperty()
        {
            var expectedResult = "New String Value";
            var facade         = new FacadeModel(new BaseModel());

            facade.AnotherStringProperty = expectedResult;

            Assert.Equal(expectedResult, facade.Dependency.StringProperty);
        }
コード例 #3
0
        public void AnotherStringPropertyOnFacadeReturnsBaseModelStringPropertyDefaultValueTest()
        {
            var model          = new BaseModel();
            var expectedResult = model.StringProperty;

            var facade = new FacadeModel(model);

            Assert.Equal(expectedResult, facade.AnotherStringProperty);
        }
コード例 #4
0
        public void IntPropertyOnWeavedFacadeReturnsBaseModelIntPropertyDefaultValueTest()
        {
            var model          = new BaseModel();
            var expectedResult = model.IntProperty;

            var facade = new FacadeModel(model);

            Assert.Equal(expectedResult, facade.IntProperty);
        }
コード例 #5
0
        public void FacadeAnotherStringPropertyChangedEventFiresOnAssignementTest()
        {
            var expectedPropertyChanged = "AnotherStringProperty";
            var resultPropertyChanged   = string.Empty;

            var facade = new FacadeModel(new BaseModel());

            var obj = (INotifyPropertyChanged)facade;

            obj.PropertyChanged += (sender, args) => resultPropertyChanged = args.PropertyName;

            facade.AnotherStringProperty = "Some New Value";

            Assert.Equal(expectedPropertyChanged, resultPropertyChanged);
        }
コード例 #6
0
        public void FacadeIntPropertyChangedEventFiresOnAssignmentTest()
        {
            var expectedPropertyChanged = "IntProperty";
            var resultPropertyChanged   = string.Empty;

            var facade = new FacadeModel(new BaseModel());

            var obj = (INotifyPropertyChanged)facade;

            obj.PropertyChanged += (sender, args) => resultPropertyChanged = args.PropertyName;

            facade.IntProperty = 999;

            Assert.Equal(expectedPropertyChanged, resultPropertyChanged);
        }