Example #1
0
        public void SenderCRU()
        {
            BrickStreetConnect brickst = makeClient();

            HttpStatusCode status;
            String         statusMessage;

            Sender s1 = new Sender();

            s1.Name          = "My Test Sender";
            s1.EmailAddress  = "mytestsender";
            s1.DepartmentID  = ConnectDepartmentID;
            s1.DefaultSender = false;

            Sender s2 = brickst.AddSender(s1, out status, out statusMessage);

            Assert.AreEqual(HttpStatusCode.OK, status);
            Assert.IsNotNull(s2);
            Assert.IsTrue(s2.Id.HasValue);
            Assert.AreEqual(s2.Name, s1.Name);
            Assert.AreEqual(s2.EmailAddress, s1.EmailAddress);
            Assert.AreEqual(s2.DepartmentID, s1.DepartmentID);
            Assert.AreEqual(s2.DefaultSender, s1.DefaultSender);

            s2.EmailAddress = "testsender";

            Sender s3 = brickst.UpdateSender(s2, out status, out statusMessage);

            Assert.AreEqual(HttpStatusCode.OK, status);
            Assert.IsNotNull(s3);
            Assert.IsTrue(s3.Id.HasValue);
            Assert.AreEqual(s3.Id.Value, s2.Id.Value);
            Assert.AreEqual(s3.Name, s2.Name);
            Assert.AreEqual(s3.EmailAddress, s2.EmailAddress);
            Assert.AreEqual(s3.DepartmentID, s2.DepartmentID);
            Assert.AreEqual(s3.DefaultSender, s2.DefaultSender);
        }