예제 #1
0
        public async Task SetEffectOverloadShouldCreateEffectWithCorrectEffect()
        {
            var deviceId = Devices.Diamondback;
            var device   = new GenericDeviceImplementation(deviceId, _api.Object);

            await device.SetEffectAsync(EffectType.Reserved);

            _api.Verify(a => a.CreateDeviceEffectAsync(deviceId, EffectType.Reserved, IntPtr.Zero), Times.Once);
        }
예제 #2
0
        public async Task SetEffectOverloadShouldCreateEffectWithZeroData()
        {
            var deviceId = Devices.BlackwidowTe;
            var device   = new GenericDeviceImplementation(deviceId, _api.Object);

            await device.SetEffectAsync(EffectType.None);

            _api.Verify(a => a.CreateDeviceEffectAsync(deviceId, EffectType.None, IntPtr.Zero), Times.Once);
        }
예제 #3
0
        public async Task ShouldCreateEffectWithCorrectEffectOnSetEffect()
        {
            var deviceId = Devices.Tartarus;
            var device   = new GenericDeviceImplementation(deviceId, _api.Object);

            await device.SetEffectAsync(EffectType.None, default(NoneEffect));

            _api.Verify(a => a.CreateDeviceEffectAsync(It.IsAny <Guid>(), EffectType.None, It.IsAny <NoneEffect>()), Times.Once);
        }
예제 #4
0
        public async Task ShouldReturnCorrectEffectIdOnSetEffect()
        {
            var deviceId = Devices.Orochi;
            var effectId = Guid.NewGuid();
            var device   = new GenericDeviceImplementation(deviceId, _api.Object);

            _api.Setup(a => a.CreateDeviceEffectAsync(deviceId, EffectType.None, default(NoneEffect))).ReturnsAsync(effectId);

            var setEffectId = await device.SetEffectAsync(EffectType.None, default(NoneEffect));

            Assert.AreEqual(effectId, setEffectId);
        }