Example #1
0
 public void WhenINeedCompanyToHaveProperty(string companyName, PropertyType type, string propertyName)
 {
     context.For <Company>(companyName)
     .Exists(propertyName, company => company.CompanyProperty);
     context.For <CompanyProperty>(propertyName)
     .IsTrue(property => property.Type == type);
 }
Example #2
0
        public void WhenINeedEmployeeNameMentionedInCompanyProperty(string name)
        {
            var employee = context.Storage.Get <IHaveToken <Employee> >();

            context.For(employee)
            .For <CompanyProperty>(name)
            .IsTrue((emp, property) => property.Name.Contains(emp.Name));
        }
Example #3
0
        public void GivenIHaveSetUpAModelWithContainingOfItems(int branches, int items)
        {
            var watch = new Stopwatch();

            models = ModelGenerator.GenerateModels(branches, items).ToList();
            watch.Stop();
            Debug.WriteLine("generate time " + watch.Elapsed);
            context.Exists("model", () => models);
            for (int i = 0; i < branches; i++)
            {
                var i1    = i;
                var token = context.For <Model>("model").Exists(model => model.Branches[i1]);
                context.For <Item>(token).IsTrue(x => x.Valid);
            }
        }
Example #4
0
 public void WhenINeedCompanyToHaveADepartment(string companyName, string departmentName)
 {
     context.For <Company>(companyName)
     .Exists(departmentName, company => company.Departments);
 }
Example #5
0
 public void GivenInsuranceIsCreatedInYear(string key, int year)
 {
     context.For <Insurance>(key)
     .IsTrue(insurance => insurance.Created.Year == year);
 }
 public void WhenISpecifyThatProjectDependsOnDepartmentAndCompanyProperty(string projKey, string depKey, string propKey)
 {
     context.For <Department>(depKey)
     .For <CompanyProperty>(propKey)
     .Exists(projKey, (department, property) => department.Projects);
 }
Example #7
0
 public void GivenForInsuranceExistsATax(string insuranceKey, string taxKey)
 {
     context.For <Insurance>(insuranceKey)
     .Exists(taxKey, insurance => insurance.Taxes);
 }
 public void GivenAssignmentHasAtLeastPeopleCovered(string key, int headCount)
 {
     context.For <Assignment>(key)
     .IsTrue(assignmen => assignmen.HeadCount >= headCount);
 }