public void Should_find_a_light_by_homeId_and_nodeId_and_valueId() { var model = new MasterModel(); var project1 = model.CreateProject(x => x.Name = "1"); var group1_1 = project1.CreateGroup(x => x.Name = "1.1"); var light1_1_1 = group1_1.AddLight(new Light(new ZWaveValueIdentity(11, 1, 123))); var light1_1_2 = group1_1.AddLight(new Light(new ZWaveValueIdentity(11, 2, 123))); var light1_1_3 = group1_1.AddLight(new Light(new ZWaveValueIdentity(11, 3, 123))); var group1_2 = project1.CreateGroup(x => x.Name = "1.2"); var light1_2_1 = group1_2.AddLight(new Light(new ZWaveValueIdentity(12, 1, 123))); var light1_2_2 = group1_2.AddLight(new Light(new ZWaveValueIdentity(12, 2, 123))); var light1_2_3 = group1_2.AddLight(new Light(new ZWaveValueIdentity(12, 3, 123))); var group1_3 = project1.CreateGroup(x => x.Name = "1.3"); var light1_3_1 = group1_3.AddLight(new Light(new ZWaveValueIdentity(13, 1, 123))); var light1_3_2 = group1_3.AddLight(new Light(new ZWaveValueIdentity(13, 2, 123))); var light1_3_3 = group1_3.AddLight(new Light(new ZWaveValueIdentity(13, 3, 123))); var project2 = model.CreateProject(x => x.Name = "1"); var group2_1 = project2.CreateGroup(x => x.Name = "2.1"); var light2_1_1 = group2_1.AddLight(new Light(new ZWaveValueIdentity(21, 1, 123))); var light2_1_2 = group2_1.AddLight(new Light(new ZWaveValueIdentity(21, 2, 123))); var light2_1_3 = group2_1.AddLight(new Light(new ZWaveValueIdentity(21, 3, 123))); var group2_2 = project2.CreateGroup(x => x.Name = "2.2"); var light2_2_1 = group2_2.AddLight(new Light(new ZWaveValueIdentity(22, 1, 123))); _expectedIdentity = new ZWaveValueIdentity(22, 2, 111); var light2_2_2 = group2_2.AddLight(new Light(_expectedIdentity)); var light2_2_2_2 = group2_2.AddLight(new Light(new ZWaveValueIdentity(22, 2, 222))); var light2_2_3 = group2_2.AddLight(new Light(new ZWaveValueIdentity(22, 3, 123))); var group2_3 = project2.CreateGroup(x => x.Name = "2.3"); var light2_3_1 = group2_3.AddLight(new Light(new ZWaveValueIdentity(23, 1, 123))); var light2_3_2 = group2_3.AddLight(new Light(new ZWaveValueIdentity(23, 2, 123))); var light2_3_3 = group2_3.AddLight(new Light(new ZWaveValueIdentity(23, 3, 123))); var found = model.FindLight(_expectedIdentity); found.ZWaveIdentity.ShouldEqual(_expectedIdentity); found.ParentGroup.ShouldBeSameAs(group2_2); found.ParentGroup.ParentProject.ShouldBeSameAs(project2); }
public void Should_move_the_light_to_the_indicated_group() { var light = _saved.FindLight(_zWaveIdentity); light.ParentGroup.Id.ShouldEqual(_destinationGroupId); }