示例#1
0
 public void ValidatePublisher()
 {
     AssertionConcern.AssertArgumentLength(this.Name, 3, 150, Errors.InvalidName);
 }
 public void SetPage(int page)
 {
     AssertionConcern.AssertArgumentNotNull(page, Errors.PageRequired);
     Page = page < 1 ? 1 : page;
 }
 public void SetTotalRows(int totalRows)
 {
     AssertionConcern.AssertArgumentNotNull(totalRows, Errors.TotalRowsRequired);
     TotalRows = totalRows;
 }
 public static bool ChangeModeScopeIsValid(this CoachingProcess coachingProcess, EModeProcess mode)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertArgumentNotNull(mode, Errors.ModeIsRequired)
                ));
 }
示例#5
0
 public static bool ChangePriceScopeIsValid(this Budget budget, float price)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertArgumentNotNull(price, Errors.PriceIsRequired)
                ));
 }
示例#6
0
 public CalendarSharer(Participant participant)
 {
     AssertionConcern.AssertArgumentNotNull(participant, "Participant must be provided.");
     this.participant = participant;
 }
 public static bool ChangeEndDateScopeIsValid(this CoachingProcess coachingProcess, DateTime endDate)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertArgumentIsGreaterOrEqualThan(endDate, coachingProcess.StartDate, Errors.StartDateIsRequired)
                ));
 }
示例#8
0
 public void Validate()
 {
     AssertionConcern.AssertArgumentLength(this.Name, 3, 200, Errors.InvalidUserName);
     EmailAssertionConcern.AssertIsValid(this.Email);
     PasswordAssertionConcern.AssertIsValid(this.Password);
 }
示例#9
0
        public ICollection <InvitationDescriptor> AllUnavailableRegistrationInvitations()
        {
            AssertionConcern.AssertStateTrue(Active, "Tenant is not active.");

            return(AllRegistrationInvitationsFor(false));
        }
示例#10
0
 public CustomerCommandResult GetByName(string name)
 {
     AssertionConcern.AssertArgumentNotEmpty(name.ToString(), "O Nome não pode ser nulo.");
     return(_repository.Get(name));
 }
 public EventStoreApplicationService(IEventStoreCoreClient eventStoreClient, ISettingsService settingsService)
 {
     AssertionConcern.AssertArgumentNotNull(eventStoreClient, nameof(eventStoreClient));
     this.eventStoreClient = eventStoreClient;
     this.settingsService  = settingsService;
 }
 public static bool PossuiNomeCidadeInformado(this AdicionaNovaCidadeCommand command)
 {
     return(AssertionConcern.IsSatisfiedBy(AssertionConcern.AssertTrue(command.Nome != string.Empty, "Nome da Cidade não informado")));
 }
 public static bool PossuiNomeCidadeUnico(this AdicionaNovaCidadeCommand command, ICidadeRepository cidadeRepository)
 {
     return(AssertionConcern.IsSatisfiedBy(AssertionConcern.AssertTrue(cidadeRepository.ObterPorNome(command.Nome) == null, "Nome da Cidade já existe")));
 }
示例#14
0
 public void IsValid()
 {
     AssertionConcern.ValidateNotEqOrLessThanMin(Height, 0, "The field height can't be equal or less than 0");
     AssertionConcern.ValidateNotEqOrLessThanMin(Width, 0, "The field width can't be equal or less than 0");
     AssertionConcern.ValidateNotEqOrLessThanMin(Length, 0, "The field length can't be equal or less than 0");
 }
 public static void AsserIsValid(string password)
 {
     AssertionConcern.AssertArgumentNotNull(password, "");
 }
示例#16
0
 public void SetCustomer(int customerId)
 {
     AssertionConcern.AssertArgumentNotNull(customerId, Errors.CustomerRequired);
     CustomerId = customerId;
 }
示例#17
0
 public static bool CreateTreinoScopIsValid(this Treino treino)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertNotEmpty(treino.DsTreino, "O campo treino é Obrigatório!")
                ));
 }
示例#18
0
 public void SetOrderNumber(string orderNumber)
 {
     AssertionConcern.AssertArgumentLength(orderNumber ?? "", OrderNumberMaxLength, string.Format(Errors.OrderNumberMaxLength, OrderNumberMaxLength));
     OrderNumber = orderNumber ?? "";
 }
 public static bool ChangeNameScopeIsValid(this CoachingProcess coachingProcess, string name)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertArgumentNotNull(name, Errors.NameIsRequired)
                ));
 }
示例#20
0
 public void Validar()
 {
     AssertionConcern.AssertArgumentNotNull(Descricao, string.Format(Erros.NullParameter, "Descricao"));
     AssertionConcern.AssertArgumentNotEmpty(Descricao, string.Format(Erros.EmptyParameter, "Descricao"));
 }
 public static bool ChangeStartDateScopeIsValid(this CoachingProcess coachingProcess, DateTime startDate)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertArgumentNotNull(startDate, Errors.StartDateIsRequired)
                ));
 }
示例#22
0
 public static void ValidTaskTitle(string title)
 {
     AssertionConcern.IsValid(
         AssertionConcern.AssertLength(title, 5, 30, "O título da tarefa deve ser maior ou igual a 5 e menor ou igual a 100 caracteres!")
         );
 }
示例#23
0
 public static bool ChangeStatusScopeIsValid(this Budget budget, EBudgetStatus status)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertArgumentNotNull(status, Errors.InvalidStatus)
                ));
 }
示例#24
0
 void AssertValidTeamMember(TeamMember teamMember)
 {
     AssertionConcern.AssertArgumentNotNull(teamMember, "A team member must be provided.");
     AssertionConcern.AssertArgumentEquals(this.TenantId, teamMember.TenantId, "Team member must be of the same tenant.");
 }
示例#25
0
 public static bool ChangeProposalScopeIsValid(this Budget budget, string proposal)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertArgumentNotNull(proposal, Errors.ProposalIsRequired)
                ));
 }
示例#26
0
 public BusinessPriority(BusinessPriorityRatings ratings)
 {
     AssertionConcern.AssertArgumentNotNull(ratings, "The ratings must be provided.");
     Ratings = ratings;
 }
示例#27
0
 public void SetRowsPerPage(int rowsPerPage)
 {
     AssertionConcern.AssertArgumentNotNull(rowsPerPage, Errors.RowsPerPageRequired);
     RowsPerPage = rowsPerPage;
 }
示例#28
0
 //Valida se o objeto instanciado está correto
 public void Valid()
 {
     AssertionConcern.AssertArgumentLength(this.Name, 3, 250, "Nome inválido");
     EmailAssertionConcern.Email(this.Email);
 }
示例#29
0
 /// <summary>
 /// validate limit order price
 /// </summary>
 private static void ValidateLimitOrderPrice(decimal limitPrice)
 {
     AssertionConcern.AssertGreaterThanZero(limitPrice, "Limit Price should be greater than 0");
 }
示例#30
0
 public void ChangeDescription(string description)
 {
     AssertionConcern.ValidateIfEmpty(description, "Product Description field cannot be empty");
     Description = description;
 }