public void When_adding_a_device_in_role_start_timer_it_must_be_stored()
        {
            // Arrange
            NetworkComposition composition = new NetworkCompositionBuilder().Build();

            // Act
            composition = composition.ChangeRolesFor(DeviceAddress, DeviceCapabilities.StartSensor,
                DeviceRoles.StartTimer);

            // Assert
            composition.IsInRoleStartTimer(DeviceAddress).Should().BeTrue();
        }
        public void When_delay_is_specified_and_start_and_finish_is_same_sensor_it_must_succeed()
        {
            // Arrange
            TimeSpan minDelay = 1.Minutes();
            NetworkComposition composition = new NetworkCompositionBuilder()
                .WithStartFinishMinDelayForSingleSensor(minDelay)
                .Build();

            // Act
            composition = composition.ChangeRolesFor(DeviceAddress, DeviceCapabilities.TimeSensor,
                DeviceRoles.StartTimer | DeviceRoles.FinishTimer);

            // Assert
            composition.IsInRoleStartTimer(DeviceAddress).Should().BeTrue();
            composition.IsInRoleFinishTimer(DeviceAddress).Should().BeTrue();
            composition.Requirements.StartFinishMinDelayForSingleSensor.Should().Be(minDelay);
            composition.IsStartFinishGate(DeviceAddress).Should().BeTrue();
        }
        public void When_adding_a_device_with_an_empty_role_it_must_not_be_in_any_known_roles()
        {
            // Arrange
            const DeviceRoles emptyRole = DeviceRoles.None;
            NetworkComposition composition = new NetworkCompositionBuilder().Build();

            // Act
            composition = composition.ChangeRolesFor(DeviceAddress, DeviceCapabilities.FinishSensor, emptyRole);

            // Assert
            composition.IsInRoleStartTimer(DeviceAddress).Should().BeFalse();
            composition.IsInRoleIntermediateTimer1(DeviceAddress).Should().BeFalse();
            composition.IsInRoleIntermediateTimer2(DeviceAddress).Should().BeFalse();
            composition.IsInRoleIntermediateTimer3(DeviceAddress).Should().BeFalse();
            composition.IsInRoleFinishTimer(DeviceAddress).Should().BeFalse();
            composition.IsStartFinishGate(DeviceAddress).Should().BeFalse();
        }