|
|
@ -21,21 +21,18 @@ namespace Sevomin.Tests |
|
|
|
|
|
|
|
internal static void Init() |
|
|
|
{ |
|
|
|
//_Job = (new List<Job>() {
|
|
|
|
// new Job{ id = 1, Name = "A", TaskDefinitions = new List<TaskDefinition>()},
|
|
|
|
// new Job{ id = 2, Name = "B", TaskDefinitions = new List<TaskDefinition>() }
|
|
|
|
//}).AsQueryable();
|
|
|
|
//_JobRepository = MockRepository.GenerateStub<IJobRepository>();
|
|
|
|
|
|
|
|
//_JobRepository.Stub(x => x.Find(Arg<long>.Is.Anything))
|
|
|
|
// .WhenCalled(x => x.ReturnValue = _Job.FirstOrDefault(y => y.id == (long)x.Arguments[0]))
|
|
|
|
// .Return(new Job());
|
|
|
|
|
|
|
|
//_JobRepository.Stub(x => x.ListAll()).Return(_Job);
|
|
|
|
//_JobRepository.Stub(x => x.FindByUsername("new-mission"))
|
|
|
|
// .Return(null);
|
|
|
|
//_JobRepository.Stub(x => x.FindByUsername(Arg<string>.Is.Anything))
|
|
|
|
// .Return(new Job() { id = 1, Username = "test", Name = "A", TaskDefinitions = new List<TaskDefinition>() });
|
|
|
|
_Job = (new List<Job>() { |
|
|
|
new Job{ Id = 1, AvalinId = "a", Avalin = new Avalin(){Id = "a", UserName="test"}, JobParameters = new List<JobParameter>(){new JobParameter{Id = 4}}}, |
|
|
|
new Job{ Id = 3, AvalinId = "b", Avalin = new Avalin(){Id = "b", UserName="B"}, JobParameters = new List<JobParameter>(){new JobParameter{Id = 4}}} |
|
|
|
}).AsQueryable(); |
|
|
|
|
|
|
|
_JobRepository = MockRepository.GenerateStub<IJobRepository>(); |
|
|
|
|
|
|
|
_JobRepository.Stub(x => x.Find(Arg<long>.Is.Anything)) |
|
|
|
.WhenCalled(x => x.ReturnValue = _Job.FirstOrDefault(y => y.Id == (long)x.Arguments[0])) |
|
|
|
.Return(new Job()); |
|
|
|
|
|
|
|
_JobRepository.Stub(x => x.ListAll()).Return(_Job); |
|
|
|
} |
|
|
|
|
|
|
|
internal static IJobRepository Instance() |
|
|
|