Skip to content

Instantly share code, notes, and snippets.

@dance2die
Created March 26, 2018 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/8d0f0f6f47f01a516f1657a7e500dd7b to your computer and use it in GitHub Desktop.
Save dance2die/8d0f0f6f47f01a516f1657a7e500dd7b to your computer and use it in GitHub Desktop.
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