public void Prepare_Title_Set() { // Arrange var addCategoryVm = new AddCategoryViewModel(crudServiceMock.Object, null, null, null, null, null); // Act addCategoryVm.Prepare(new ModifyCategoryParameter()); // Assert addCategoryVm.Title.ShouldEqual(Strings.AddCategoryTitle); }
public void Prepare_CategoryCreated() { // Arrange var addCategoryVm = new AddCategoryViewModel(crudServiceMock.Object, null, null, null, null, null); // Act addCategoryVm.Prepare(new ModifyCategoryParameter()); // Assert addCategoryVm.SelectedCategory.ShouldNotBeNull(); }
public async Task SaveCategory_EmptyName_ReturnMessage() { // Arrange dialogServiceMock.Setup(x => x.ShowMessage(It.IsAny <string>(), It.IsAny <string>())) .Returns(Task.CompletedTask); var addCategoryVm = new AddCategoryViewModel(crudServiceMock.Object, dialogServiceMock.Object, settingsFacadeMock.Object, backupServiceMock.Object, null, null); addCategoryVm.Prepare(new ModifyCategoryParameter()); // Act await addCategoryVm.SaveCommand.ExecuteAsync(); // Assert dialogServiceMock.Verify(x => x.ShowMessage(Strings.MandatoryFieldEmptyTitle, Strings.NameRequiredMessage)); }