Coder Social home page Coder Social logo

Comments (1)

xRushG avatar xRushG commented on May 20, 2024

I can confirm the error you encountered. It arises due to the limitations imposed by the nature of static classes and readonly fields. Since GeneralAppInfo is a static class with a readonly field ApplicationVersion, direct modification for testing purposes is not feasible within the current setup. However, one workaround is to introduce a protected static method within GeneralAppInfo that allows setting the application version internally, and then changing ApplicationVersion to have a private setter.

public static string ApplicationVersion { get; private set; } = Application.ProductVersion;

public static void SetApplicationVersion(string version)
{
    ApplicationVersion = version;
}

You can then use SetApplicationVersion in NUnit tests. However, it's worth noting that this approach may not provide significant benefits, as there are no checks implemented in the setter method. I dont know.

I've encountered additional issues following the recent changes:
1)
image

To resolve this, I need to change the project settings' langVersion from 'latest' to 'preview'. However, I'm not sure if this is the best approach. What do you think?

image

Perhaps this is a typo:

string detailsString = string.Join("; ", [.. details]);

The corrected version would be:

string detailsString = string.Join("; ",  details);

Can anyone else confirm this?

Consider temporarily removing the read only flag for 'Application Version' in your local repository without committing the change. If you encounter the other two bugs, address them similar.

from mremoteng.

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.