Beispiel #1
0
        public void WithCharacteristics_ForCharacteristic_AddsCharacteristic(
            DeskCharacteristics sut,
            IGenericAccess genericAccess)
        {
            sut.WithCharacteristics(DeskCharacteristicKey.GenericAccess,
                                    genericAccess);

            sut.Characteristics
            .Should( )
            .Contain(x => x.Key == DeskCharacteristicKey.GenericAccess &&
                     x.Value == genericAccess);
        }
        public void Create_ForInvokedWithCharacteristics_AddsGenericAccess(
            DeskCharacteristicsCreator sut,
            IDeskCharacteristics characteristics,
            IDevice device,
            [Freeze] IGenericAccess characteristic)
        {
            characteristics.WithCharacteristics(Arg.Any <DeskCharacteristicKey> ( ),
                                                Arg.Any <ICharacteristicBase> ( ))
            .Returns(characteristics);

            sut.Create(characteristics,
                       device);

            characteristics.Received( )
            .WithCharacteristics(DeskCharacteristicKey.GenericAccess,
                                 characteristic);
        }
Beispiel #3
0
        public void ToString_ForInvoked_Instance(
            DeskCharacteristics sut,
            IGenericAccess genericAccess,
            IGenericAttribute genericAttribute)
        {
            sut.WithCharacteristics(DeskCharacteristicKey.GenericAccess,
                                    genericAccess);
            sut.WithCharacteristics(DeskCharacteristicKey.GenericAttribute,
                                    genericAttribute);

            using var scope = new AssertionScope( );

            sut.ToString( )
            .Should( )
            .Contain("GenericAccess");

            sut.ToString( )
            .Should( )
            .Contain("GenericAttribute");
        }
Beispiel #4
0
        public async Task Refresh_ForInvoked_CallsCharacteristicRefresh(
            DeskCharacteristics sut,
            IGenericAccess genericAccess,
            IGenericAttribute genericAttribute)
        {
            sut.WithCharacteristics(DeskCharacteristicKey.GenericAccess,
                                    genericAccess);
            sut.WithCharacteristics(DeskCharacteristicKey.GenericAttribute,
                                    genericAttribute);

            await sut.Refresh( );

            using var scope = new AssertionScope( );

            await genericAccess.Received( )
            .Refresh( );

            await genericAttribute.Received( )
            .Refresh( );
        }