public async Task DisableAlertNotification(HubAlert alert) { await Protocol.SendMessageAsync(new HubAlertMessage(alert, HubAlertOperation.DisableUpdates) { HubId = HubId, }); }
public async Task EnableAlertNotificationAsync(HubAlert alert) { await Protocol.SendMessageAsync(new HubAlertMessage() { HubId = HubId, Operation = HubAlertOperation.EnableUpdates, Alert = alert, }); }
public void HubAlertEncoder_Encode(HubAlert alert, HubAlertOperation operation, byte payload, string expectedData) { // arrange var message = new HubAlertMessage(alert, operation, payload); // act var data = MessageEncoder.Encode(message, null); // assert Assert.Equal(expectedData, BytesStringUtil.DataToString(data)); }
public void HubAlertEncoder_Decode(HubAlert expectedAlert, HubAlertOperation expectedOperation, byte expectedPayload, string dataAsString) { // arrange var data = BytesStringUtil.StringToData(dataAsString); // act var message = MessageEncoder.Decode(data, null) as HubAlertMessage; // assert Assert.Equal(expectedAlert, message.Alert); Assert.Equal(expectedOperation, message.Operation); Assert.Equal(expectedPayload, message.DownstreamPayload); }