예제 #1
0
         public void MyTestInitialize() 
         {
             probeResultFactory = new ProbeResultFactory();
             dataprovider = new LocalDataProvider();
             MockRepository mocks = new MockRepository();

             provider = mocks.StrictMock<IDataProvider>();
             Expect.Call(provider.GetSession()).Repeat.Any().Return(dataprovider.GetSession());                                       
             mocks.ReplayAll();

         }
예제 #2
0
 public void Initialize()
 {
     DataProvider = new LocalDataProvider();
     SessionDefault = this.GetSession();
     Repository = new CollectRequestRepository(DataProvider);
     FakeScheduler = MockRepository.GenerateMock<IScheduler>();
     fakeProbeManager = MockRepository.GenerateMock<IProbeManager>();
     fakeScheduleController = MockRepository.GenerateMock<IScheduleController>();
     definitionFactory = new DefinitionDocumentFactory(DataProvider);
     fakeCollectAssembler = new CollectRequestAssembler(DataProvider);
     fakeResultAssembler = new CollectResultAssembler();
     fakePackageAssembler = new CollectPackageAssembler(DataProvider);
     CollectController = new CollectController(Repository, FakeScheduler, fakeScheduleController, fakeProbeManager, fakeCollectAssembler, fakeResultAssembler, fakePackageAssembler, definitionFactory);
 }
예제 #3
0
 public void MyTestInitialize()
 {
     provider = new LocalDataProvider();
 }
예제 #4
0
 public void Should_be_possible_to_get_CollectResultDTO_from_CollectResult()
 {
     LocalDataProvider provider = new LocalDataProvider();
     var fakeSession = provider.GetSession();
     CollectRequest collectRequest = new CollectRequestFactory().CreateCollectRequestCompleteAfterCollect(fakeSession);
     fakeSession.SaveChanges();
     CollectResultAssembler assembler = new CollectResultAssembler();
     var collectResult = assembler.CreateDTOFromCollectResult(fakeSession, collectRequest);
     Assert.IsNotNull(collectResult);
     Assert.IsNotNull(collectResult.Date);
     Assert.IsNotNull(collectResult.SystemCharacteristics);
 }
예제 #5
0
        public void Should_be_possible_to_get_A_compressed_execution_Log_from_CollectResult()
        {
            LocalDataProvider provider = new LocalDataProvider();
            var fakeSession = provider.GetSession();
            CollectRequest collectRequest = new CollectRequestFactory().CreateCollectRequestCompleteAfterCollect(fakeSession);
            fakeSession.SaveChanges();
            CollectResultAssembler assembler = new CollectResultAssembler();
            var serializedCollectLog = assembler.CreateCompressedSerializedExecutionLog(fakeSession, collectRequest);
            var collectResult = JsonConvert.DeserializeObject<IEnumerable<ExecutionLog>>(serializedCollectLog.ToUncompressedString());

            Assert.IsNotNull(serializedCollectLog);

            Assert.IsNotNull(collectResult);
            Assert.IsTrue(collectResult.Count() > 0);
        }
예제 #6
0
 private IEnumerable<CollectExecutionLog> GetExecutionLogs()
 {
     LocalDataProvider provider = new LocalDataProvider();
     IDocumentSession fakeSession = provider.GetSession();
     CollectRequest collectRequest = new CollectRequestFactory().CreateCollectRequestCompleteAfterCollect(fakeSession);
     fakeSession.SaveChanges();
     IEnumerable<CollectExecutionLog> executionLogs = collectRequest.GetExecutionLog(fakeSession);
     return executionLogs;
 }
 public void MyTestInitialize() 
 {
     provider = new LocalDataProvider();
     session = provider.GetSession();            
 }