private ICollection <ProcessDefinition <TKey> > GetDefinitions() { var builder = new ProcessDefinitionBuilder <TKey, TProcessEnum>(); builder.Autogenerate(); return(builder.Definitions); }
public void Given_FullEnumTypeWithDescriptions_When_Add_Then_AllProcessDefinitionWithNameAndDescriptionCreated() { var builder = new ProcessDefinitionBuilder <int, TestUndefinedProcesses>(); var expectedList = EnumsHelper.GetEnumList <TestUndefinedProcesses>(); builder.Autogenerate(); Assert.AreEqual(builder.Count, expectedList.Count()); Assert.IsTrue(builder.Definitions.Any(x => expectedList.Contains(EnumsHelper.GetByString <TestUndefinedProcesses>(x.Name)))); Assert.IsTrue(builder.Definitions.Any(x => expectedList.Contains(EnumsHelper.GetByDescription <TestUndefinedProcesses>(x.Description)))); }
public void Given_EnumWithProcessDefinitionAttributes_When_Add_Then_AllProcessDefinitionWithNameDescriptionAndTypeCreated() { var builder = new ProcessDefinitionBuilder <int, TestExtraDefinedProcesses>(); var expectedList = EnumsHelper.GetEnumList <TestExtraDefinedProcesses>(); builder.Autogenerate(); Assert.AreEqual(builder.Count, expectedList.Count()); Assert.IsTrue(builder.Definitions.Any(x => expectedList.Contains(EnumsHelper.GetByString <TestExtraDefinedProcesses>(x.Name)))); Assert.IsTrue(builder.Definitions.Any(x => expectedList.Contains(EnumsHelper.GetByDescription <TestExtraDefinedProcesses>(x.Description)))); Assert.IsTrue(builder.Definitions.Any(x => x.Type == Enums.ProcessType.Background)); Assert.IsTrue(builder.Definitions.Any(x => x.Type == Enums.ProcessType.Batch)); }