This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using NodaTime; | |
using System; | |
using System.Globalization; | |
Console.WriteLine(TimeZoneInfo.Local.Id); | |
Console.WriteLine(DateTimeZoneProviders.Tzdb.GetSystemDefault().Id); | |
Environment.SetEnvironmentVariable("TZ", "Europe/Paris"); | |
TimeZoneInfo.ClearCachedData(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using System.Data; | |
var dt = new DataTable | |
{ | |
Columns = { "id", "name" }, | |
Rows = { { "x", "y" } } | |
}; | |
string json = JsonConvert.SerializeObject(dt); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options = new CreateExtractJobOptions | |
{ | |
Labels = JobLabels, | |
LoadConfigurationModifier = op => op.UseAvroLogicalTypes = true | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (int i = 0; i < 10; i++) | |
{ | |
if (i % 2 != 0) | |
{ | |
Console.WriteLine(i); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Quantite> list = new List<Quantite> | |
{ | |
new Quantite | |
{ | |
Poids = 0, | |
Palette = 33, | |
UniteSpecifique = "test" | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void CultureDayNameTest() | |
{ | |
var polishCulture = CultureInfo.CreateSpecificCulture("pl-PL"); | |
DateTime date = new DateTime(2023, 9, 16); | |
// Format the day of the week in the Polish culture. Without specifying | |
// the culture, the current culture is used. | |
string stringDay = date.ToString("dddd", polishCulture); | |
stringDay.ShouldContain(DayOfWeek.Saturday.ToString()); //Not passed | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
class Value | |
{ | |
private readonly int x; | |
public Value(int x) | |
{ | |
this.x = x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
struct Point | |
{ | |
public int x; | |
public int y; | |
} | |
class Test | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Threading.Tasks; | |
class Test | |
{ | |
static async Task Main() | |
{ | |
// (Include the error message in the post.) | |
_ = await Condition() ? await M1() : await M2(); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test { | |
private String name; | |
public void printName(Test other) { | |
System.out.println(other.name); | |
} | |
} |