Noda Time targets .NET 4.5 and .NET Standard 1.3. For maximum compatibility, we don't use dynamic typing within the distributable libraries, but occasionally do so within tests.
Although Noda Time users don't need a recent C# compiler, we typically use language features
as soon as they're available under general release (and sometimes in stable beta). We try
very hard not to add any external dependencies, however - which prevents the use of
C# 7 tuples for the moment (as System.ValueTuple
would be an extra dependency).
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
if (args.Length > 1)
{
Console.WriteLine("Hello " + args[0]);
}
else
{
Console.WriteLine("Hello world!");
}
}
}
}
Using Tools | Import and Export Settings the C# formatting settings can be selectively saved and then reloading. All the C# formatting options fall under All Options | Options | Text Editor | C# Editor. (The "C#" option holds the non-formatting settings.)
Follow a Method_State_Result
pattern:
Method
is the name of the method being tested, possibly with some more information for overload disambiguationState
describes the scenario that is being testedResult
describes what is the expected behaviorWhen any of the last two is really redundant, it can be omitted, like when the
State
would be ValidValues
or similar, or the Result
would be ItWorks
.