Closed LuizFrra closed 5 years ago
This validation is adding notification if its false and not adding else. Example : `
public class Name : ValueObject { public string FirstName { get; private set; } public string LastName { get; private set; } public Name(string firstName, string lastName) { AddNotifications(new Contract().Requires().IsNullOrEmpty(firstName, "Nome", "Nome Inválido")); FirstName = firstName; LastName = lastName; } }`
Name name = new Name("", "Poe");
Console Output :
----- Test Execution Summary ----- PaymentContext.Tests.StudentTests.TestMethod1: Outcome: Passed Total tests: 1. Passed: 1. Failed: 0. Skipped: 0
----- Test Execution Summary -----
PaymentContext.Tests.StudentTests.TestMethod1: Outcome: Passed
Total tests: 1. Passed: 1. Failed: 0. Skipped: 0
if you changue the Method name to IsNotNullOrEmpty and do the inverse with IsNotNullOrEmpty fix everything.
THanks!! There`s a PR for that! Working on it!
This validation is adding notification if its false and not adding else. Example : `
Name name = new Name("", "Poe");
Console Output :
if you changue the Method name to IsNotNullOrEmpty and do the inverse with IsNotNullOrEmpty fix everything.