Example #1
0
 private void InitRandomValues()
 {
     Name        = $"{ProjectType}-{new Random().Next(10000)}";
     ProjectType = RandomValueGenerator.GetEnumRandomValue <OuterProjectType>();
     StartDate   = new DateTime();
     EndDate     = StartDate.AddDays(new Random().Next(2000));
     Prize       = Calculator.CalculateOuterProjectCost(StartDate, EndDate, ProjectType);
 }
Example #2
0
 public Client(int id)
 {
     Id          = id;
     Name        = RandomValueGenerator.GetEnumRandomValue <NameEnum>().ToString();
     Surname     = RandomValueGenerator.GetEnumRandomValue <SurnameEnum>().ToString();
     CompanyName = new Random().NextDouble() < 0.6 ? RandomValueGenerator.GetRandomCompanyName(this) : "";
     ClientType  = CompanyName.Length == 0 ? ClientTypeEnum.INDYWIDUALNY : ClientTypeEnum.ORGANIZACJA;
 }
Example #3
0
 private void InitRandomValues()
 {
     Specialization = RandomValueGenerator.GetEnumRandomValue <ArchitectureTypeEnum>();
     Name           = RandomValueGenerator.GetEnumRandomValue <NameEnum>().ToString();
     Surname        = RandomValueGenerator.GetEnumRandomValue <SurnameEnum>().ToString();
     BirthDate      = RandomValueGenerator.GetRandomBirthDate();
     Phone          = RandomValueGenerator.GetPhoneNumber();
     ContractId     = new Random().Next();
     CanSupervise   = new Random().Next() % 2 == 0;
     Pesel          = RandomValueGenerator.GetPesel();
 }
Example #4
0
 public Project(int id, DateTime clientOrderDate, int clientId)
 {
     Id = id;
     ClientOrderDate  = clientOrderDate;
     ClientId         = clientId;
     ArchitectureType = RandomValueGenerator.GetEnumRandomValue <ArchitectureTypeEnum>();
     StartDate        = new DateTime();
     EndDate          = StartDate.AddDays(new Random().Next(300));
     Prize            = Calculator.CalculateProjectCost(StartDate, EndDate, ArchitectureType);
     TotalPrize       = Prize;
     Size             = (EndDate - StartDate).Days;
     Status           = StatusEnum.PRZYJETO_DO_REALIZACJI;
 }
Example #5
0
 public void Generate(int amount, params object[] parameters)
 {
     while (IsAnyProjectRunning())
     {
         var type = RandomValueGenerator.GetEnumRandomValue <ArchitectureTypeEnum>();
         var connectionCreated = CreateConnection(type);
         if (connectionCreated && IsSameDay())
         {
             continue;
         }
         CurrentDate = CurrentDate.AddDays(1);
         FreeArchitects();
     }
     Console.WriteLine(CurrentDate);
 }
Example #6
0
        private List <Architect> GetArchitectsToUpdate(int amount)
        {
            var architectsToUpdate = new List <Architect>();

            for (var i = 0; i < amount; i++)
            {
                var architectureType = RandomValueGenerator.GetEnumRandomValue <ArchitectureTypeEnum>();
                if (!AvailableArchitects[architectureType].Any())
                {
                    continue;
                }
                architectsToUpdate.Add(AvailableArchitects[architectureType].First(a => a.Active));
                AvailableArchitects[architectureType].RemoveAt(0);
            }
            return(architectsToUpdate);
        }
Example #7
0
 private void InitRandomValues()
 {
     Name    = RandomValueGenerator.GetEnumRandomValue <NameEnum>().ToString();
     Surname = RandomValueGenerator.GetEnumRandomValue <SurnameEnum>().ToString();
     Phone   = RandomValueGenerator.GetPhoneNumber();
 }