示例#1
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");
        }
示例#2
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!");
        }
示例#3
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");
        }