Beispiel #1
0
        static async Task Main(string[] args)
        {
            Console.WriteLine("=================    Generic Where Constraints Examples ======================");
            GenericWhereConstraints.Examples();
            Console.WriteLine("=================    Fixed Memory Examples ======================");
            FixedKeywordExamples.Examples();
            Console.WriteLine("=================    readonly Keyword Examples ======================");
            ReadonlyKeywordExamples.Examples();
            Console.WriteLine("=================    using Keyword Examples ======================");
            UsingStatements.Examples();
            Console.WriteLine("=================    try-catch Keyword Examples ======================");
            await AsyncExceptionExamples.Examples();

            Console.WriteLine("=================    try-catch Keyword Examples ======================");
            CheckedAndUnchecked.Examples();
        }
 public static void RunUnchecked() => Assert.That(() => CheckedAndUnchecked.UncheckedAdd(int.MaxValue, int.MaxValue),
                                                  Throws.Nothing);
 public static void RunChecked() => Assert.That(() => CheckedAndUnchecked.CheckedAdd(int.MaxValue, int.MaxValue),
                                                Throws.TypeOf <OverflowException>());
Beispiel #4
0
 public void Checked() => CheckedAndUnchecked.CheckedAdd(3, 33);