Пример #1
0
        public void UpdateMember()
        {
            var    list          = new MemberList();
            var    member        = new Member();
            string name          = "cheng";
            string streetAddress = "379 4th Ave S";
            string city          = "Saint Cloud";
            string state         = "MN";
            string ZIPcode       = "56301";

            member.Name          = name;
            member.StreetAddress = streetAddress;
            member.City          = city;
            member.State         = state;
            member.ZipCode       = ZIPcode;

            var newMemberId = list.InsertMember(member);

            Assert.IsTrue(null != newMemberId, "Adding Fail");

            var result = list.UpdateMember(name, newMemberId.Value, streetAddress,
                                           city, state, "56000", member.Status);

            Assert.IsTrue(null != result, "update fail");
        }
Пример #2
0
        public void InsertMember()
        {
            var list   = new MemberList();
            var member = new Member();

            member.Name          = "Cheng luo";
            member.StreetAddress = "123 77th Ave S";
            member.State         = "MN";
            member.City          = "Saint Cloud";
            member.ZipCode       = "12345";

            var newMemberId = list.InsertMember(member);
            var tempmember  = list.GetMember(newMemberId.Value);

            Assert.IsTrue(null != newMemberId, "Adding Fail");
            Assert.IsTrue(null != tempmember, "Return member does not exist");

            Assert.AreEqual(member.Name, tempmember.Name, "Name are not equal");
            Assert.AreEqual(member.StreetAddress, member.StreetAddress, "StreetAddress are not the same");
            Assert.AreEqual(member.State, tempmember.State, "State are not the same");
            Assert.AreEqual(member.City, tempmember.City, "City are not the same");
            Assert.AreEqual(member.ZipCode, tempmember.ZipCode, "ZIPCode are not the same");

            var deleteSuccess = list.DeleteMember(newMemberId.Value);

            Assert.IsTrue(deleteSuccess, "Delete Fail");
        }
Пример #3
0
        public void GetAllServiceRecordForMember()
        {
            var memberlist = new MemberList();
            var member     = new Member();

            member.Name          = "Zhao";
            member.StreetAddress = "123 77th Ave S";
            member.State         = "MN";
            member.City          = "Saint Cloud";
            member.ZipCode       = "12345";

            var newMemberId = memberlist.InsertMember(member);

            Assert.IsTrue(null != newMemberId, "Adding member Fail!");

            var list           = new ServiceRecordList();
            var serviceRecord  = new ServiceRecord(1231, DateTime.Now, DateTime.Today, 100, newMemberId.Value, "Hello, This is a Test!");
            var serviceRecord2 = new ServiceRecord(1231, DateTime.Now, DateTime.Today, 100, newMemberId.Value, "Hello, This is a Test!");

            var result1 = list.InsertServiceRecord(serviceRecord);
            var result2 = list.InsertServiceRecord(serviceRecord2);

            Assert.IsTrue(null != result1, "Adding Fail!");
            Assert.IsTrue(null != result2, "Adding Fail!");

            var result = list.GetAllServiceRecordForMember(newMemberId.Value);

            Assert.IsTrue(null != result, "Get list Fail!");
        }
Пример #4
0
        public void GetMember()
        {
            var list   = new MemberList();
            var member = new Member();

            member.Name          = "Cheng luo";
            member.StreetAddress = "123 77th Ave S";
            member.State         = "MN";
            member.City          = "Saint Cloud";
            member.ZipCode       = "12345";

            var newmemberID = list.InsertMember(member);

            Assert.IsTrue(null != newmemberID, "Adding Member Failed!");
            var result = list.GetMember(newmemberID.Value);

            Assert.IsTrue(null != result, "Returned member does not exist");
            var deleteResult = list.DeleteMember(newmemberID.Value);

            Assert.IsTrue(deleteResult, "Delete Fail");
        }
Пример #5
0
        public void DeleteMember()
        {
            var    list   = new MemberList();
            Member member = new Member();

            member.Name          = "LUO";
            member.StreetAddress = "397 4th Ave S";
            member.City          = "Saint Cloud";
            member.State         = "MN";
            member.ZipCode       = "56301";

            var newmemberID = list.InsertMember(member);

            Assert.IsTrue(null != newmemberID, "Insert member Fail");

            var result = list.DeleteMember(newmemberID.Value);

            Assert.IsTrue(result, "Delete Fail");

            var negitiveTest = list.DeleteMember(0);

            Assert.IsFalse(negitiveTest, "Delete member not exsit!");
        }