Beispiel #1
0
        private ICollection <ProcessDefinition <TKey> > GetDefinitions()
        {
            var builder = new ProcessDefinitionBuilder <TKey, TProcessEnum>();

            builder.Autogenerate();

            return(builder.Definitions);
        }
Beispiel #2
0
        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))));
        }
Beispiel #3
0
        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));
        }