Created
August 10, 2017 20:15
-
-
Save Vector241-Eric/8d01474a09e3ccf6a4571e64f1648c6e to your computer and use it in GitHub Desktop.
Move a light between groups
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
public class When_moving_a_light_from_one_group_to_another | |
{ | |
private LightGroup _fooGroup; | |
private LightGroup _barGroup; | |
private Light _light; | |
[SetUp] | |
public void ContextSetup() | |
{ | |
var model = new MasterModel(); | |
_fooGroup = model.CreateProject().CreateGroup(); | |
_barGroup = model.CreateProject().CreateGroup(); | |
var zWaveIdentity = new ZWaveValueIdentity(1, 2, 123); | |
_light = new Light(zWaveIdentity); | |
_fooGroup.AddLight(_light); | |
model.AssignLightToGroup(zWaveIdentity, _barGroup.Id); | |
} | |
[Test] | |
public void Should_remove_the_light_from_the_original_group() | |
{ | |
_fooGroup.Lights.Length.ShouldEqual(0); | |
} | |
[Test] | |
public void Should_add_the_light_to_the_new_group() | |
{ | |
_barGroup.Lights.Length.ShouldEqual(1); | |
_barGroup.Lights[0].ZWaveIdentity.ValueId.ShouldEqual((ulong)123); | |
_light.ParentGroup.ShouldBeSameAs(_barGroup); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment