Example #1
0
 public void ConfigWorkerCallsDeserializerDeserialize()
 {
     var stubReader = MockRepository.GenerateStub<IConfigReader>();
     var stubDeserializer = MockRepository.GenerateStub<IDeserializer>();
     var workerTest = new ConfigWorker<SampleClass>(stubReader, stubDeserializer);
     workerTest.Work();
     stubDeserializer.AssertWasCalled(d => d.Deserialize<SampleClass>(Arg<string>.Is.Anything), o => o.Repeat.Once());
 }
Example #2
0
 public void ConfigWorkerCallsConfigReaderRead()
 {
     var stubReader = MockRepository.GenerateStub<IConfigReader>();
     var stubDeserializer = MockRepository.GenerateStub<IDeserializer>();
     var workerTest = new ConfigWorker<object>(stubReader, stubDeserializer);
     workerTest.Work();
     stubReader.AssertWasCalled(r => r.ReadConfig(), o => o.Repeat.Once());
 }