About 34,800 results
Open links in new tab
  1. Is it good practice to make everything internal in C#?

    Aug 30, 2019 · Inside the business layer, we use models to transfer data from classes to classes. Is it good practice to make these models and all their properties, methods and constructors internal? …

  2. Should accessible members of an internal class be internal too?

    In another generated class (part of a parser/scanner), there is a structure that contains fields for all possible values it can represent. The class generated is internal too but I have control over the …

  3. c# - Dependency injection for a library with internal dependencies ...

    May 23, 2017 · The vendor's classes are all marked internal to keep the web developers from circumventing the services layer (either intentionally or unintentionally). So the flow goes like this: …

  4. Should I unit test "internal" classes? - Software Engineering Stack ...

    Jul 27, 2021 · Any class that is marked public (or internal or package private in some languages, which just means it's only publicly accessible in the same assembly or package) is eligible for unit testing, …

  5. c# - Would you rather make private stuff internal/public for tests, or ...

    Would you rather make private stuff internal/public for tests, or use some kind of hack like PrivateObject? Ask Question Asked 13 years, 11 months ago Modified 3 years, 1 month ago

  6. Am I understanding the new C# naming conventions right?

    Sep 27, 2021 · So calling an internal field from another class would look like this: internal class MyClass1 { internal int _myInt; } internal class MyMainClass { private MyClass1 _myClass1 = new …

  7. c# - Is it bad practice to make methods public solely for the sake of ...

    Mar 2, 2015 · Making them internal - that depends. Instead of making all methods to be tested public, and instead of redesigning your classes completely, sometimes the most pragmatic solution is to …

  8. Best way to unit test methods that call other methods inside same class

    Sep 9, 2016 · I was recently discussing with some friends which of the following 2 methods is best to stub return results or calls to methods inside same class from methods inside same class.

  9. c# - Setting up private properties for unit testing - Software ...

    I'm doing some TDD practice for my own learning. I'm trying to figure out how to transparently set up private properties of an object to support testing. I have a binary tree node: internal class N...

  10. c# - Is it Good Practice to Only Expose Interfaces - Software ...

    Sep 19, 2022 · You can't "seal" your interfaces to consumer-side code. What you can do is to only expose an abstract base class: If all its constructors are internal, your API users can't inherit from it. …