示例#1
0
        public void ResetClearsTextFields()
        {
            // Arrange
            var vm = new AddEntryViewModel( Enumerable.Empty<TagViewModel>(), null );

            // Act
            vm.Summary = "test";
            vm.Details = "test";
            vm.Reset();

            // Assert
            Assert.IsTrue( string.IsNullOrEmpty( vm.Summary ) );
            Assert.IsTrue( string.IsNullOrEmpty( vm.Details ) );
        }
示例#2
0
        public void ResetClearsTagSelection()
        {
            // Arrange
            var tags = new[]
            {
                new TagViewModel( new Tag {Id = 1, Name = "Tag1"} ),
                new TagViewModel( new Tag {Id = 2, Name = "Tag2"} )
            };

            var vm = new AddEntryViewModel( tags, null );

            // Act
            vm.Tags[1].IsSelected = true;
            vm.Reset();

            // Assert
            Assert.IsTrue( vm.Tags.All( t => !t.IsSelected ) );
        }