public void Create_Cancelled_ThrowsCancellationException()
        {
            // Create an immediate cancellation
            var source = new CancellationTokenSource();

            source.Cancel();

            Assert.Throws <OperationCanceledException>(() => PRNGFortunaProviderFactory.Create(token: source.Token));
        }
Ejemplo n.º 2
0
        public async static Task Main(string[] args)
        {
            var builder = new HostBuilder()
                          .ConfigureServices((services) =>
                                             services
                                             .AddSingleton(_ => PRNGFortunaProviderFactory.Create())
                                             .AddSingleton <ConfigFacade>()
                                             .AddSingleton <GambleConfigFacade>()
                                             .AddSingleton <GambleFacade>()
                                             .AddHostedService <Bot>());

            await builder.RunConsoleAsync();
        }
 public PRNGFortunaProviderTests(ITestOutputHelper output)
 {
     _output = output;
     _sut    = PRNGFortunaProviderFactory.Create() as PRNGFortunaProvider;
 }
 public PRNGFortunaProviderTests()
 {
     _sut = PRNGFortunaProviderFactory.Create() as PRNGFortunaProvider;
 }