public void ContextSetup() { var existingMasterModel = new MasterModel(); var project = existingMasterModel.CreateProject(x => x.Name = "Existing Project"); var existingGroup = project.CreateGroup(x => x.Name = "Existing Group"); var repository = new StubMasterModelRepository(); repository.UseCurrentModel(existingMasterModel); var creator = new LightGroupManager(repository); _result = creator.Update(existingGroup.Id, "Existing Group"); _savedModel = repository.LastSaved; }
public void ContextSetup() { var existingMasterModel = new MasterModel(); var parentProject = existingMasterModel.CreateProject(x => x.Name = "Existing Project"); var existingGroup = parentProject.CreateGroup(x => x.Name = "Existing Group"); _idDoesNotExist = Guid.NewGuid(); var repository = new StubMasterModelRepository(); repository.UseCurrentModel(existingMasterModel); var creator = new LightGroupManager(repository); _result = creator.Delete(_idDoesNotExist); _savedModel = repository.LastSaved; }
public void ContextSetup() { var existingMasterModel = new MasterModel(); _parentProject = existingMasterModel.CreateProject(x => x.Name = "Existing Project"); var existingGroup = _parentProject.CreateGroup(x => x.Name = "Existing Group"); existingGroup.AddLight(new Light(new ZWaveValueIdentity(1, 1, 123))); existingGroup.AddLight(new Light(new ZWaveValueIdentity(1, 2, 123))); _remainingGroup = _parentProject.CreateGroup(); _remainingGroup.AddLight(new Light(new ZWaveValueIdentity(1, 10, 123))); var repository = new StubMasterModelRepository(); repository.UseCurrentModel(existingMasterModel); var creator = new LightGroupManager(repository); _result = creator.Delete(existingGroup.Id); _savedModel = repository.LastSaved; }