コード例 #1
0
        public void ReturnsValidObj()
        {
            // The safe wrapper should overwrite the valid object with default(obj1)
            obj1 o1 = null;

            Assert.DoesNotThrow(() => {
                o1 = WrapErr.SafeAction(() => {
                    return(new obj1());
                });
            });
            Assert.IsNotNull(o1);
        }
コード例 #2
0
 public void DefaultObjectOnThrow()
 {
     // The safe wrapper should overwrite the valid object with default(obj1)
     obj1 o1 = new obj1();
     Assert.DoesNotThrow(() => {
         o1= WrapErr.SafeAction(() => {
             string s2 = null;
             string s3 = s2.Substring(0, 10);
             return new obj1();
         });
     });
     Assert.AreEqual(o1, default(obj1));
     Assert.IsNull(o1);
 }
コード例 #3
0
        public void DefaultObjectOnThrow()
        {
            // The safe wrapper should overwrite the valid object with default(obj1)
            obj1 o1 = new obj1();

            Assert.DoesNotThrow(() => {
                o1 = WrapErr.SafeAction(() => {
                    string s2 = null;
                    string s3 = s2.Substring(0, 10);
                    return(new obj1());
                });
            });
            Assert.AreEqual(o1, default(obj1));
            Assert.IsNull(o1);
        }
コード例 #4
0
        static void Main(string[] args)
        {
            int opcion;

            Class1 obj1 = new obj1();
            Class1 obj2 = new obj2();
            Class1 obj3 = new obj3();
            Class1 obj4 = new obj4();

            Console.WriteLine("***MENU DE OPCIONES***");
            Console.WriteLine("Para multiplicar ingrese 1");
            Console.WriteLine("Para dividir ingrese 2");
            Console.WriteLine("Para ingresar nombres digite 3");
            Console.WriteLine("Para ingresar edades digite 4");
            opcion = int.Parse(Console.ReadLine());

            switch :
            {
コード例 #5
0
    public bool SendNotification(obj1 obj)
    {
        var sender = new SendSMS();

        return(sender.Send(obj));
    }
コード例 #6
0
 if (ReferenceEquals(obj1, obj2))
 {
     return(true);
コード例 #7
0
 EnumerateMembers(obj1, obj2, type.BaseType, fields, properties, methods, name);
コード例 #8
0
 return(Equals(obj1, obj2));