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 ) ); }
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 ) ); }