コード例 #1
0
        public void RgbPropertyViewModelTest()
        {
            // Since this property viewmodel commits its change as soon as the change is made, the commitChange method
            // is executed, which requires a working IoC
            IoC.GetInstance = IoCAggregator;

            ColorPropertyViewModel en  = new ColorPropertyViewModel();
            ColorInputNode         clr = new ColorInputNode();
            PropertyDescriptor     pd  = TypeDescriptor.GetProperties(clr).Find("color", true);

            en.Initialize(clr, pd);

            clr.Color = System.Windows.Media.Color.FromRgb(1, 33, 7);
            Assert.Equal(new YuvKA.VideoModel.Rgb(1, 33, 7), new YuvKA.VideoModel.Rgb(en.ChosenColor.R, en.ChosenColor.G, en.ChosenColor.B));
            en.ChosenColor = System.Windows.Media.Color.FromRgb(42, 24, 22);
            Assert.Equal(System.Windows.Media.Color.FromRgb(42, 24, 22), clr.Color);
        }
コード例 #2
0
ファイル: PropertyViewModelTest.cs プロジェクト: Kha/YUV.KA
		public void RgbPropertyViewModelTest()
		{
		    // Since this property viewmodel commits its change as soon as the change is made, the commitChange method
		    // is executed, which requires a working IoC
		    IoC.GetInstance = IoCAggregator;

		    ColorPropertyViewModel en = new ColorPropertyViewModel();
		    ColorInputNode clr = new ColorInputNode();
		    PropertyDescriptor pd = TypeDescriptor.GetProperties(clr).Find("color", true);
		    en.Initialize(clr, pd);

			clr.Color = System.Windows.Media.Color.FromRgb(1, 33, 7);
		    Assert.Equal(new YuvKA.VideoModel.Rgb(1, 33, 7), new YuvKA.VideoModel.Rgb(en.ChosenColor.R, en.ChosenColor.G, en.ChosenColor.B));
		    en.ChosenColor = System.Windows.Media.Color.FromRgb(42, 24, 22);
			Assert.Equal(System.Windows.Media.Color.FromRgb(42, 24, 22), clr.Color);
		}