private void AddErrors(SeIdentityResult result) { foreach (var error in result.Errors) { ModelState.AddModelError("", error); } }
private void AssertValidationResultFailed(SeIdentityResult result, string errorMessageContains) { Assert.IsFalse(result.Succeeded); Assert.AreEqual(1, result.Errors.Count()); if (!string.IsNullOrEmpty(errorMessageContains)) { Assert.IsTrue(result.Errors.All(a => a.Contains(errorMessageContains))); } }