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); }
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); }
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); }
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); }