public void CanSave_PublisherIsNull_ReturnsFalse() { var model = new AddEditSeriesViewModel(null, null, null); model.CheckPassedSeriesAsync(null); model.SetErrorsChangedEventAsync(); model.InputModel.Name = "Random Name"; model.InputModel.Description = "Rand desc"; Assert.False(model.CanSave); }
public void NameErrorMessage_SetsProperly() { var model = new AddEditSeriesViewModel(null, null, null); model.CheckPassedSeriesAsync(null); model.SetErrorsChangedEventAsync(); model.InputModel.Name = " "; Assert.True(model.InputModel.HasErrors); Assert.False(model.CanSave); Assert.Equal(model.InputModel.GetFirstError("Name"), model.NameErrorMessage); }