Created
March 26, 2018 01:31
-
-
Save dance2die/8d0f0f6f47f01a516f1657a7e500dd7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class RandomPaymentStrategy : IPaymentStrategy | |
{ | |
public ProcessStatus Process(double amount) | |
{ | |
var random = new Random(); | |
var randomValue = random.Next(0, 2); | |
return (ProcessStatus)Math.Min(randomValue, 2); | |
} | |
} | |
public class PaypalPaymentStrategy : RandomPaymentStrategy { } | |
public class ApplePayPaymentStrategy : RandomPaymentStrategy { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment