示例#1
0
 public void TestFillObservableShouldSuccess()
 {
     LayersWindowViewModel vm = new LayersWindowViewModel();
     IList<Item> items = new List<Item>()
     {
         new Item(){ItemName = "Item1", ItemAmount = 1, CreationDate=DateTime.Now},
         new Item(){ItemName = "Item2", ItemAmount = 2, CreationDate=DateTime.Now},
         new Item(){ItemName = "Item3", ItemAmount = 3, CreationDate=DateTime.Now}
     };
     var result = vm.FillObservable(items);
     Assert.AreEqual(3, result.Count);
     Assert.AreEqual("Item1", result[0].ItemName);
     Assert.AreEqual("Item2", result[1].ItemName);
     Assert.AreEqual("Item3", result[2].ItemName);
     Assert.AreEqual(1, result[0].ItemAmount);
     Assert.AreEqual(2, result[1].ItemAmount);
     Assert.AreEqual(3, result[2].ItemAmount);
 }
示例#2
0
 //public LayersWindowViewModel Model { get; set; }
 public MainWindow()
 {
     InitializeComponent();
     Model = new LayersWindowViewModel();
 }