Create() public static method

public static Create ( Type jobType ) : JobDescription
jobType System.Type
return JobDescription
Ejemplo n.º 1
0
        public static IEnumerable <JobDescription> GetAllAvailableJobs()
        {
            var jobdefs = typeof(WorkService)
                          .Assembly
                          .GetExportedTypes()
                          .Where(t => !t.IsAbstract && typeof(JobHandlerBase).IsAssignableFrom(t))
                          .Select(t => JobDescription.Create(t))
                          .Where(d => d != null);

            return(jobdefs);
        }
Ejemplo n.º 2
0
 public void GivenAJobWithClassNameNotEndingJob_ItReturnsTheWholeTypeName()
 {
     Assert.Equal("ATestJerb", JobDescription.Create(typeof(ATestJerb)).Name);
 }
Ejemplo n.º 3
0
 public void GivenAJobWithAttribute_ItReturnsTheNameFromTheAttribute()
 {
     Assert.Equal("ATestJob", JobDescription.Create(typeof(ATestJorb)).Name);
 }
Ejemplo n.º 4
0
 public void GivenAJobWithClassNameEndingJob_ItReturnsThePartBeforeTheWordJob()
 {
     Assert.Equal("ATest", JobDescription.Create(typeof(ATestJob)).Name);
 }