コード例 #1
0
            public void ContextSetup()
            {
                _now = new DateTime(2011, 1, 2, 3, 4, 5);
                SetSystemClock(_now);

                var fileStorage = S <IFileSystemStorage>();

                fileStorage.Stub(x => x.ReadMasterModel()).Return(null);

                var unassignedLightService = new StubUnassignedLightService().WithZeroUnassignedLights();

                var repository = new MasterModelRepository(fileStorage, unassignedLightService);

                _result = repository.GetCurrent();
            }
コード例 #2
0
            public void ContextSetup()
            {
                _model = new MasterModel {
                    LastUpdatedDate = DateTime.Now
                };
                _now = new DateTime(2010, 4, 5);

                SetSystemClock(_now);

                IUnassignedLightService doNotUseUnassignedLightService = null;

                var fileStorage = new StorageStub();
                var respository = new MasterModelRepository(fileStorage, doNotUseUnassignedLightService);

                respository.Save(_model);

                _lastSaved = fileStorage.LastSaved;
            }
コード例 #3
0
            public void ContextSetup()
            {
                SetSystemClock(new DateTime(2011, 1, 2, 3, 4, 5));

                _existingModel = new MasterModel {
                    LastUpdatedDate = new DateTime(2014, 1, 1)
                };

                var fileStorage = S <IFileSystemStorage>();

                fileStorage.Stub(x => x.ReadMasterModel()).Return(_existingModel);

                var unassignedLightService = new StubUnassignedLightService()
                                             .WithUnassignedLight(new Light(new ZWaveValueIdentity(1, 3, 123)));

                var repository = new MasterModelRepository(fileStorage, unassignedLightService);

                _result = repository.GetCurrent();
            }