コード例 #1
0
        public void BackupItemsTest()
        {
            ObservableCollection<BackupItemViewModel> actual;
            actual = target.BackupItems;
            Assert.IsNotNull(actual);
            Assert.IsEmpty(actual);

            BackupItemType bit;
            BackupItemViewModel bivm;
            target.BackupItems.Add(bivm = new BackupItemViewModel(bit = new BackupItemType()));
            actual = target.BackupItems;
            Assert.IsNotEmpty(actual);
            Assert.AreEqual(1, actual.Count);
            Assert.AreSame(bivm, actual[0]);
        }
コード例 #2
0
        public void CloneTest()
        {
            BackupDataViewModel expected = target;
            BackupDataViewModel actual;
            actual = target.Clone();
            Assert.AreNotEqual(expected, actual);
            Assert.AreEqual(expected.DatasetName, actual.DatasetName);
            Assert.AreEqual(0, actual.BackupItems.Count);
            Assert.AreEqual(expected.BackupItems, actual.BackupItems);
            Assert.AreElementsEqual(expected.BackupItems, actual.BackupItems);

            BackupItemType bit;
            BackupItemViewModel bivm;
            target.BackupItems.Add(bivm = new BackupItemViewModel(bit = new BackupItemType()));
            actual = target.Clone();
            Assert.AreNotEqual(expected, actual);
            Assert.AreEqual(expected.DatasetName, actual.DatasetName);
            Assert.AreEqual(1, actual.BackupItems.Count);
            Assert.AreEqual(expected.BackupItems, actual.BackupItems);
            Assert.AreElementsEqual(expected.BackupItems, actual.BackupItems);
        }