Beispiel #1
0
        public void TestMethod1()
        {
            var t = new P10();

            Assert.IsTrue(t.IsMatch("aa", "a*"));
            Assert.IsTrue(t.IsMatch("ab", ".*"));
            Assert.IsTrue(t.IsMatch("aab", "a*bc*"));
            Assert.IsTrue(t.IsMatch("aaab", "a*ab"));
            Assert.IsTrue(t.IsMatch("aab", "c*a*b"));
            Assert.IsFalse(t.IsMatch("aa", "c*a*b"));
            Assert.IsFalse(t.IsMatch("mississippi", "mis*is*p*."));
            Assert.IsTrue(t.IsMatch("bbbbba", ".*a*a"));
            Assert.IsTrue(t.IsMatch("a", "a*a"));
            Assert.IsFalse(t.IsMatch("ab", ".*c"));
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("****************************************");
                {
                    Abstract.AbstractPhone phone = new ApplePhone();
                    phone.System();
                    phone.Call();
                }
                {
                    Abstract.AbstractPhone phone = new P10();
                    phone.System();
                    phone.Call();

                    dynamic dyn_phone = phone;
                    dyn_phone.System();
                    dyn_phone.Movie();
                    dyn_phone.Price = 19;
                    Console.WriteLine("Price:{0}", dyn_phone.Price);
                }
                Console.WriteLine();
                Console.WriteLine("****************************************");
                {
                    IExtend extend = new ApplePhone();
                    extend.Movie();
                    extend.Price = 19;
                    Console.WriteLine("Price:{0}", extend.Price);
                }

                {
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.ReadKey();
        }
Beispiel #3
0
 public bool Equals(ValidationReferenceTypeModel?other)
 {
     if (other is null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return
         (P1 == other.P1 &&
          P2 == other.P2 &&
          P3 == other.P3 &&
          MathF.Abs(P4 - other.P4) < 0.001f &&
          Math.Abs(P5 - other.P5) < 0.001 &&
          P6.Equals(other.P6) &&
          P7.Equals(other.P7) &&
          PN1_0 == other.PN1_0 &&
          PN1_1 == other.PN1_1 &&
          PN2 == other.PN2 &&
          PN3_0 == other.PN3_0 &&
          PN3_1 == other.PN3_1 &&
          (PN4.HasValue && other.PN4.HasValue && MathF.Abs(PN4.Value - other.PN4.Value) < 0.001f ||
           PN4 == null && other.PN4 == null) &&
          (PN5.HasValue && other.PN5.HasValue && Math.Abs(PN5.Value - other.PN5.Value) < 0.001 ||
           PN5 == null && other.PN5 == null) &&
          (PN6.HasValue && other.PN6.HasValue && PN6.Value.Equals(other.PN6.Value) ||
           PN6 == null && other.PN6 == null) &&
          (PN7_0.HasValue && other.PN7_0.HasValue && PN7_0.Value.Equals(other.PN7_0.Value) ||
           PN7_0 == null && other.PN7_0 == null) &&
          (PN7_1.HasValue && other.PN7_1.HasValue && PN7_1.Value.Equals(other.PN7_1.Value) ||
           PN7_1 == null && other.PN7_1 == null) &&
          (P8_0 != null && other.P8_0 != null && P8_0.Equals(other.P8_0) ||
           P8_0 == null && other.P8_0 == null) &&
          (P8_1 != null && other.P8_1 != null && P8_1.Equals(other.P8_1) ||
           P8_1 == null && other.P8_1 == null) &&
          (P8_2 != null && other.P8_2 != null && P8_2.Equals(other.P8_2) ||
           P8_2 == null && other.P8_2 == null) &&
          (P9_0 != null && other.P9_0 != null && P9_0.Length == other.P9_0.Length && P9_0.Zip(other.P9_0).All(t => t.First == t.Second) ||
           P9_0 == null && other.P9_0 == null) &&
          (P9_1 != null && other.P9_1 != null && P9_1.Length == other.P9_1.Length && P9_1.Zip(other.P9_1).All(t => t.First == t.Second) ||
           P9_1 == null && other.P9_1 == null) &&
          (P10 != null && other.P10 != null && P10.Length == other.P10.Length && P10.Zip(other.P10).All(t => t.First == t.Second) ||
           P10 == null && other.P10 == null) &&
          (P11_0 != null && other.P11_0 != null && P11_0.Length == other.P11_0.Length && P11_0.Zip(other.P11_0).All(t => t.First == t.Second) ||
           P11_0 == null && other.P11_0 == null) &&
          (P11_1 != null && other.P11_1 != null && P11_1.Length == other.P11_1.Length && P11_1.Zip(other.P11_1).All(t => t.First == t.Second) ||
           P11_1 == null && other.P11_1 == null) &&
          (P12_0 != null && other.P12_0 != null && P12_0.Count == other.P12_0.Count && P12_0.Zip(other.P12_0).All(t => t.First == t.Second) ||
           P12_0 == null && other.P12_0 == null) &&
          (P12_1 != null && other.P12_1 != null && P12_1.Count == other.P12_1.Count && P12_1.Zip(other.P12_1).All(t => t.First == t.Second) ||
           P12_1 == null && other.P12_1 == null) &&
          (PN12 != null && other.PN12 != null && PN12.Count == other.PN12.Count && PN12.Zip(other.PN12).All(t => t.First == t.Second) ||
           PN12 == null && other.PN12 == null) &&
          (P13 != null && other.P13 != null && P13.Count == other.P13.Count && P13.Zip(other.P13).All(t => t.First == t.Second) ||
           P13 == null && other.P13 == null) &&
          StructuralComparer.IsMatch(P14, other.P14) &&
          StructuralComparer.IsMatch(P15, other.P15) &&
          StructuralComparer.IsMatch(P16, other.P16) &&
          StructuralComparer.IsMatch(P17, other.P17) &&
          StructuralComparer.IsMatch(P18, other.P18) &&
          StructuralComparer.IsMatch(P19, other.P19) &&
          StructuralComparer.IsMatch(P20, other.P20) &&
          StructuralComparer.IsMatch(P21 as Dictionary <string, int?>, other.P21 as Dictionary <string, int?>) &&
          StructuralComparer.IsMatch(P22 as Dictionary <string, JsonResponseModel?>, other.P22 as Dictionary <string, JsonResponseModel?>));
 }