Пример #1
0
        public void TestTextureItemViewModel_SetAndClearDuplicate()
        {
            // Arrange
            string               path       = @"c:\foo";
            string               fileName   = "testimage";
            string               extension  = ".png";
            string               extension2 = ".tga";
            string               id         = Path.Combine(path, fileName) + extension;
            string               id2        = Path.Combine(path, fileName) + extension2;
            TextureModel         modelA     = new TextureModel(id);
            TextureModel         modelB     = new TextureModel(id2);
            TextureItemViewModel vm         = new TextureItemViewModel();

            // Act
            vm.Model = modelA;
            vm.SetDuplicateModel(modelB);
            vm.ClearDuplicateModel();

            // Assert
            Assert.IsNull(vm.DuplicateModel, "DuplicateModel property was NOT null!");
            Assert.IsNull(vm.HasDuplicate, "HasDuplicate property was not null!");
        }
Пример #2
0
        public void TestTextureItemViewModel_HasDuplicate()
        {
            // Arrange
            string       path       = @"c:\foo";
            string       fileName   = "testimage";
            string       extension  = ".png";
            string       extension2 = ".tga";
            string       id         = Path.Combine(path, fileName) + extension;
            string       id2        = Path.Combine(path, fileName) + extension2;
            TextureModel modelA     = new TextureModel(id);
            TextureModel modelB     = new TextureModel(id2);

            // Act
            TextureItemViewModel vm = new TextureItemViewModel();

            vm.Model = modelA;
            vm.SetDuplicateModel(modelB);

            // Assert
            Assert.IsNotNull(vm.DuplicateModel, "DuplicateModel property was null!");
            Assert.AreSame(modelB, vm.DuplicateModel, "DuplicateModel property was not ModelB!");
            Assert.IsNotNull(vm.HasDuplicate, "HasDuplicate property was null!");
            Assert.IsTrue(vm.HasDuplicate.Value, "HasDuplicate property was not True");
        }