コード例 #1
0
        public void GetHashCode_OtherLeadItemWithDifferentElement_ReturnsDifferentValue()
        {
            var value1 = new LeadItem <int>(42, 17);
            var value2 = new LeadItem <int>(41, 17);

            Assert.That(value2.GetHashCode(), Is.Not.EqualTo(value1.GetHashCode()));
        }
コード例 #2
0
        public void GetHashCode_OtherLeadItemWithSameValues_ReturnsSameValue()
        {
            var value1 = new LeadItem <int>(42, 17);
            var value2 = new LeadItem <int>(42, 17);

            Assert.That(value2.GetHashCode(), Is.EqualTo(value1.GetHashCode()));
        }
コード例 #3
0
        public void Equals_ItselfBoxed_ReturnsTrue()
        {
            var value = new LeadItem <int>(42, 17);

            bool result = value.Equals((object)value);

            Assert.That(result, Is.True);
        }
コード例 #4
0
        public void Equals_NullReference_ReturnsFalse()
        {
            var value = new LeadItem <int>(42, 17);

            bool result = value.Equals(null);

            Assert.That(result, Is.False);
        }
コード例 #5
0
        public void Equals_OtherLeadItemWithSameValues_ReturnsTrue()
        {
            var value1 = new LeadItem <int>(42, 17);
            var value2 = new LeadItem <int>(42, 17);

            bool result = value1.Equals(value2);

            Assert.That(result, Is.True);
        }
コード例 #6
0
        public void Equals_OtherLeadItemWithDifferentLeadingElement_ReturnsFalse()
        {
            var value1 = new LeadItem <int>(42, 17);
            var value2 = new LeadItem <int>(42, 18);

            bool result = value1.Equals(value2);

            Assert.That(result, Is.False);
        }
コード例 #7
0
 public HttpResponseMessage Submit(string fullName, string contactNumber, string Email, string comments, string source, int PropertyId)
 {
     try
     {
         LeadItem model = new LeadItem()
         {
             Comments          = comments,
             ContactNumber     = contactNumber,
             CoreUserId        = null,
             Email             = Email,
             FullName          = fullName,
             PropertyListingID = PropertyId,
             IsManual          = false,
             Source            = source
         };
         LeadCreation.CaptureLead(model);
         return(Request.CreateResponse(HttpStatusCode.OK, "Lead Saved"));
     }
     catch (Exception e)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, e.Message.ToString()));
     }
 }
コード例 #8
0
        public void LeadingElement_AfterGivingValueInConstructor_RetainsGivenValue(int testcase)
        {
            var value = new LeadItem <int>(0, testcase);

            Assert.That(value.LeadingElement, Is.EqualTo(testcase));
        }