Exemplo n.º 1
0
 public DownloaderTests(ITestOutputHelper helper) : base(helper)
 {
     Helpers.Init();
     _unsubMsgs = Utils.LogMessages.OfType <IInfo>().Subscribe(onNext: msg => XunitContext.WriteLine(msg.ShortDescription));
     _unsubErr  = Utils.LogMessages.OfType <IUserIntervention>().Subscribe(msg =>
                                                                           XunitContext.WriteLine("ERROR: User intervention required: " + msg.ShortDescription));
 }
Exemplo n.º 2
0
    public Task Write_lines()
    {
        XunitContext.Write("part1");
        XunitContext.Write(" part2");
        XunitContext.WriteLine();
        XunitContext.WriteLine("part3");
        var logs = XunitContext.Flush(false);

        return(Verifier.Verify(logs));
    }
Exemplo n.º 3
0
 public override void WriteLine(string value)
 {
     if (value == null)
     {
         XunitContext.WriteLine();
     }
     else
     {
         XunitContext.WriteLine(value);
     }
 }
Exemplo n.º 4
0
        public EndToEndTests(ITestOutputHelper helper) : base(helper)
        {
            Queue           = new WorkQueue();
            Consts.TestMode = true;

            utils      = new TestUtils();
            utils.Game = Game.SkyrimSpecialEdition;

            _unsub = Utils.LogMessages.Subscribe(f => XunitContext.WriteLine($"{DateTime.Now} - {f}"));

            _downloadFolder.CreateDirectory();
        }
Exemplo n.º 5
0
        public ACompilerTest(ITestOutputHelper helper) : base(helper)
        {
            Helpers.Init();
            Consts.TestMode = true;

            utils      = new TestUtils();
            utils.Game = Game.SkyrimSpecialEdition;

            DateTime startTime = DateTime.Now;

            _unsub = Utils.LogMessages.Subscribe(f => XunitContext.WriteLine($"{DateTime.Now - startTime} -  {f.ShortDescription}"));
        }
Exemplo n.º 6
0
    public async Task Async()
    {
        await Task.Delay(1);

        XunitContext.WriteLine("part1");
        await Task.Delay(1);

        XunitContext.WriteLine("part2");
        await Task.Delay(1);

        var logs = XunitContext.Flush(false);
        await Verifier.Verify(logs);
    }
Exemplo n.º 7
0
 private static void CheckResponse(AuthenticationResponse response)
 {
     if (!response.IsAuthenticated)
     {
         if (response.ResponseCode == "KS-E500")
         {
             XunitContext.WriteLine("SERVER ERROR");
         }
         XunitContext.WriteLine($"{response.ResponseCode}:{response.ResponseMessage}");
         string logs = string.Concat(XunitContext.Logs.Select(x => x));
         Assert.True(response.IsAuthenticated, logs);
     }
 }
Exemplo n.º 8
0
    public void Usage()
    {
        XunitContext.WriteLine("From Test");

        ClassBeingTested.Method();

        var logs = XunitContext.Logs;

        Assert.Contains("From Test", logs);
        Assert.Contains("From Trace", logs);
        Assert.Contains("From Debug", logs);
        Assert.Contains("From Console", logs);
        Assert.Contains("From Console Error", logs);
    }
Exemplo n.º 9
0
        public ABuildServerSystemTest(ITestOutputHelper output, SingletonAdaptor <BuildServerFixture> fixture) : base(output)
        {
            Filters.Clear();
            _unsubMsgs = Utils.LogMessages.OfType <IInfo>().Subscribe(onNext: msg => XunitContext.WriteLine(msg.ShortDescription));
            _unsubErr  = Utils.LogMessages.OfType <IUserIntervention>().Subscribe(msg =>
                                                                                  XunitContext.WriteLine("ERROR: User intervention required: " + msg.ShortDescription));
            _client       = new Client();
            _authedClient = new Client();
            Fixture       = fixture.Deref();
            _authedClient.Headers.Add(("x-api-key", Fixture.APIKey));
            AuthorAPI.ApiKeyOverride = Fixture.APIKey;
            _queue  = new WorkQueue();
            Queue   = new WorkQueue();
            _random = new Random();

            Consts.ModlistSummaryURL  = MakeURL("lists/status.json");
            Consts.ServerWhitelistURL = MakeURL("ServerWhitelist.yaml");
        }
Exemplo n.º 10
0
    public Task Null()
    {
        XunitContext.WriteLine("XunitLogger.WriteLine");
        XunitContext.WriteLine();
        XunitContext.WriteLine("Console.WriteLine(null)");
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
        Console.WriteLine((string)null);
#pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type.
        XunitContext.WriteLine("Debug.WriteLine(null)");
        Debug.WriteLine(null);
        XunitContext.WriteLine("Debug.Write(null)");
        Debug.Write(null);
        XunitContext.WriteLine("Trace.WriteLine(null)");
        Trace.WriteLine(null);
        XunitContext.WriteLine("Trace.Write(null)");
        Trace.Write(null);
        var logs = XunitContext.Flush(false);
        return(Verifier.Verify(logs));
    }
Exemplo n.º 11
0
 protected ATestBase(ITestOutputHelper output) : base(output)
 {
     _unsub = Utils.LogMessages.Subscribe(f => XunitContext.WriteLine($"{DateTime.Now} - {f}"));
 }
Exemplo n.º 12
0
 public override void WriteLine()
 {
     XunitContext.WriteLine();
 }