public void MapToPlatformUsageEnum_FromString_ExpectedResult(string input, PlatformUsage expectedResult) { // Arrange + Act var result = input.MapToPlatformUsageEnum(); // Assert Assert.AreEqual(expectedResult, result); }
public void MapToString_FromPlatformUsageEnum_ExpectedResult(PlatformUsage input, string expectedResult) { // Arrange + Act var result = input.MapToString(); // Assert Assert.AreEqual(expectedResult, result); }
/// <summary> /// Maps the <see cref="PlatformUsage"/> to its corresponding Tikkie API string. /// </summary> /// <param name="platformUsage">The platform usage as enum.</param> /// <returns>The platform usage in string format.</returns> /// <exception cref="ArgumentException">When the platform usage enum is not recognized.</exception> public static string MapToString(this PlatformUsage platformUsage) { switch (platformUsage) { case PlatformUsage.PaymentRequestForMyself: return("PAYMENT_REQUEST_FOR_MYSELF"); case PlatformUsage.PaymentRequestForOthers: return("PAYMENT_REQUEST_FOR_OTHERS"); default: throw new ArgumentException($"Not recognized {nameof(platformUsage)}"); } }