public void TwinTryParseOperationTests(string input, bool expectedOutcome, TwinAddressHelper.Operation expectedOperation, string expectedSubresource, string[] expectedProperties) { var properties = new Dictionary <StringSegment, StringSegment>(); TwinAddressHelper.Operation operation; StringSegment subresource; Assert.Equal(expectedOutcome, TwinAddressHelper.TryParseOperation(input, properties, out operation, out subresource)); if (!expectedOutcome) { return; } Assert.Equal(expectedOperation, operation); Assert.Equal(expectedSubresource, subresource.ToString()); Dictionary <StringSegment, StringSegment> expectedPropertyMap = ComposeMapFromPairs(expectedProperties, k => new StringSegment(k), v => new StringSegment(v)); Assert.Equal(expectedPropertyMap, properties); }
public void TwinFormatDirectRequestTopic(string correlationId, string methodName, string expectedResult) { Assert.Equal(expectedResult, TwinAddressHelper.FormatDeviceMethodRequestAddress(correlationId, methodName)); }