Giter Club home page Giter Club logo

Comments (10)

douglasg14b avatar douglasg14b commented on May 26, 2024 1

You can see how I'm checking for the console here:

m_consoleAvailable = Environment.UserInteractive && Console.Title.Length > 0;

This can throw an exception, so wrap in try/catch block. Exception probably means no console available, that's what I assume anyways.

You can always assign this to a variable, debug your tests, and see if that variable is true/false.

from betterconsoletables.

atari-monk avatar atari-monk commented on May 26, 2024 1

No i dont. It worked then in 2022. Probably still works. Not using this app at the moment. I like library. It works fine for me. You can close, thx.

from betterconsoletables.

atari-monk avatar atari-monk commented on May 26, 2024

I cleaned this up in test so it can pass
just letting you know about it if u didnt encoutered it

from betterconsoletables.

douglasg14b avatar douglasg14b commented on May 26, 2024

Can you provide a formatted (three backticks, code block) example of the output for the VS run and the dotnet cli run for comparison?

from betterconsoletables.

atari-monk avatar atari-monk commented on May 26, 2024

Sorry i dont know this formating thing.
This is output to txt file from VSCode run test
VSCode-RunAllTests.zip
This is output from dotnet test
Dotnet test.zip
I use notepad++ with endline switch on or this https://www.diffchecker.com/. To compare it.
My test table looks like this

[17:57:14 INF] Read Item
┌──────┬───────────┐
│  Id  │    Name   │
├──────┼───────────┤
│ 1639 │ Christine │
└──────┴───────────┘

I add code like this, to clean white spaces so test will pass

var linesOut = outputText!.Split(EOL).ToList();
        var length = linesOut[0].IndexOf("┐") + 1;
        linesOut[0] = linesOut[0].Substring(0, length);
        linesOut[2] = linesOut[2].Substring(0, length);
        linesOut[4] = linesOut[4].Substring(0, length);
        PrintToFile(expected, linesOut);
        outputText = string.Join(EOL, linesOut);
        Assert.Equal(expected, outputText);

Not a big deal, still learning to use this lib.

from betterconsoletables.

douglasg14b avatar douglasg14b commented on May 26, 2024

Looks like they are different

VSCode RunAllTests:

  • Expected: 839dc8c1e298ab9b30b90fe0ef018859deb7dfb2b8aee18f502dc8ffb4ee354d
  • Actual: 839dc8c1e298ab9b30b90fe0ef018859deb7dfb2b8aee18f502dc8ffb4ee354d

Dotnet Test

  • Expected: cf64b2fefc18c9464e1aaddf82ef4b90bb7a938722a57e9c54911d836ea979fd
  • Actual: fe4b8563de8560584489246a53ddf4d0cfe66637a7fdd7053e8d7abceaadbcd9

Are either of these being ran in a terminal or with a console available at runtime, or are they being ran headless?

The dotnet test one is padding the end of the output with whitespace, which is behavior I would expect if Console is available at runtime.

from betterconsoletables.

atari-monk avatar atari-monk commented on May 26, 2024

sorry i dont know
I just use Link in class test to run tests from VSCode
and in VSCode terminal i type dotnet test to run theese. i dont know how this affects stuff.
I also use CommandDotNet lib
It was just something weird for me so i wanted to show it to better coder.
I'am implementing rest of the columns and it;s not a problem.

from betterconsoletables.

douglasg14b avatar douglasg14b commented on May 26, 2024

Unfortunately I would need to know if Console is available to further help debug this and/or a repro that I can run.

You can test this by asserting if the console is or is not available during your tests.

from betterconsoletables.

atari-monk avatar atari-monk commented on May 26, 2024

Code is in my repos (inventory-min-cli-app), it's difficult to build thow since it consists of many separate projects.
I dont know how to assert this. Will google this.

from betterconsoletables.

douglasg14b avatar douglasg14b commented on May 26, 2024

Do you still need he;p with this problem?

from betterconsoletables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.