public void EmailAddress_Positive_Get()
        {
            MailCarrier target = new MailCarrier();

            target.EmailAlias = "aline.vetrov";
            string expected = "*****@*****.**";

            Assert.AreEqual(expected, target.EmailAddress);
        }
        public void Name_Positive_Get()
        {
            MailCarrier target = new MailCarrier();

            target.EmailAlias = "aline.vetrov";
            string expected = "aline vetrov";

            Assert.AreEqual(expected, target.Name);
        }
        public void EmailAlias_Positive_Set()
        {
            MailCarrier   target   = new MailCarrier();
            string        expected = "aline.vetrov";
            PrivateObject pObj     = new PrivateObject(target);

            target.EmailAlias = expected;
            Assert.AreEqual(expected, pObj.GetField("emailAlias"));
        }
Пример #4
0
 public static void Non_default_carriers_can_be_unlocked(MailCarrier actual)
 {
     if (actual.Flags.SingleOrDefault() == MailCarrierFlag.Default)
     {
         Assert.Empty(actual.UnlockItems);
     }
     else
     {
         Assert.NotEmpty(actual.UnlockItems);
     }
 }
Пример #5
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Limit?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Case?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Carrier?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Shipper?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (MailShipper.GetHashCode());
            hashCode = hashCode * -1521134295 + (MailCarrier.GetHashCode());
            hashCode = hashCode * -1521134295 + (CustomMail?.GetHashCode() ?? 0);
            return(hashCode);
        }
Пример #6
0
        //LD_VISITOR_000
        public static void RunVisitorBehavioralPattern()
        {
            //first set up the structure
            List <IElement> list = new List <IElement>();

            list.Add(new Household("The Adams Family"));
            list.Add(new Household("The Jones Family"));
            list.Add(new BusinessEntity("The Oatmeal Bakery"));
            list.Add(new BusinessEntity("The Ice Cream Shop"));

            //use one visitor, or logic
            IVisitor visitor = new SantaClaus();

            foreach (IElement i in list)
            {
                i.Accept(visitor);   //apply the logic to the element
            }
            //use another visitor, or logic
            visitor = new MailCarrier();
            foreach (IElement i in list)
            {
                i.Accept(visitor);  //apply the logic to the element
            }
        }
Пример #7
0
 public static void Icon_is_not_empty(MailCarrier actual) => Assert.NotEmpty(actual.Icon);
Пример #8
0
 public static void Order_is_not_negative(MailCarrier actual) =>
 Assert.InRange(actual.Order, 0, 1000);
Пример #9
0
 public static void Name_is_not_empty(MailCarrier actual) => Assert.NotEmpty(actual.Name);
Пример #10
0
 public static void Id_is_positive(MailCarrier actual) =>
 Assert.InRange(actual.Id, 1, int.MaxValue);
 public void EmailAddress_Negative_Get()
 {
     MailCarrier target   = new MailCarrier();
     string      expected = target.EmailAddress;
 }
 public void Name_Negative_Get()
 {
     MailCarrier target   = new MailCarrier();
     string      expected = target.Name;
 }