コード例 #1
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the item of test data
            clsCustomer testItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            testItem.CustomerId           = 1;
            testItem.CustomerName         = "Suraj";
            testItem.CustomerEmailAddress = "*****@*****.**";
            testItem.CustomerDOB          = DateTime.Parse("19/07/2000");
            testItem.CustomerAddress      = "12, Marydene drive";
            testItem.Member = true;
            //set this address to the test data
            AllCustomers.ThisCustomer = testItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //set the primary key of the test data
            testItem.CustomerId = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
コード例 #2
0
        public void AddMethodOK()
        {
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            clsCustomer           TestItem     = new clsCustomer();
            int PrimaryKey = 0;

            TestItem.Name              = "Joe,Bloggs";
            TestItem.Address           = "2 Random Street,RandomTown,RandomCounty,RN27FT";
            TestItem.Email             = "*****@*****.**";
            TestItem.Password          = "******";
            TestItem.Marketing_emails  = false;
            TestItem.Registration_date = DateTime.Now.Date;

            AllCustomers.ThisCustomer = TestItem;

            PrimaryKey = AllCustomers.Add();

            TestItem.Customer_id = PrimaryKey;

            AllCustomers.ThisCustomer.Find(PrimaryKey);

            Assert.AreEqual(AllCustomers.ThisCustomer, TestItem);

            AllCustomers.Delete();
        }
コード例 #3
0
        public void DeleteMethodOK()
        {
            //create an instance of the class to create
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create some test data to assign
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.UserNumber      = 1;
            TestItem.FirstName       = "Hanna";
            TestItem.LastName        = "Burrows";
            TestItem.HouseNumber     = 40;
            TestItem.Town            = "Leicester";
            TestItem.Street          = "Pastures";
            TestItem.PostCode        = "ab12 3ab";
            TestItem.Email           = "*****@*****.**";
            TestItem.TelephoneNumber = 12345;
            //assign the data to the property
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //set the primary key of test data
            TestItem.UserNumber = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
コード例 #4
0
        public void DeleteMethodOK()
        {
            //create an instance of the customer collection class
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the item of the test data
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //sets its properties
            TestItem.Active         = true;
            TestItem.BillingAddress = "A Addresss LE33BA";
            TestItem.DateOfBirth    = DateTime.Now.AddYears(-18);
            TestItem.Email          = "A email @ hmail.com";
            TestItem.Id             = 1;
            TestItem.Name           = "A Name";
            TestItem.Pass           = "******";
            //set ThisCustomer to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //set the primary key of the test data
            TestItem.Id = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see of the record was not found
            Assert.IsFalse(Found);
        }
コード例 #5
0
        public void DeleteMethodOk()
        {
            clsCustomerCollection AllCustomers = new clsCustomerCollection();

            clsCustomer TestItem = new clsCustomer();

            Int32 Primarykey = 0;

            TestItem.Active     = true;
            TestItem.CustomerNo = 005;
            TestItem.Name       = "Mike";
            TestItem.Surname    = "Spike";
            TestItem.Mail       = "*****@*****.**";
            TestItem.Address    = "PoolStreet 12";


            AllCustomers.ThisCustomer = TestItem;

            Primarykey = AllCustomers.Add();

            TestItem.CustomerNo = Primarykey;

            AllCustomers.ThisCustomer.Find(Primarykey);

            AllCustomers.Delete();

            Boolean Found = AllCustomers.ThisCustomer.Find(Primarykey);

            Assert.IsFalse(Found);
        }
コード例 #6
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the item of test data
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.CustomerNo  = 1;
            TestItem.Email       = "*****@*****.**";
            TestItem.Name        = "somename";
            TestItem.Password    = "******";
            TestItem.DateOfBirth = DateTime.Now.Date.AddYears(-18);
            TestItem.Address     = "123 Leicester Street";
            TestItem.Archived    = false;
            //set ThisCustomer to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //set the primary key of the test data
            TestItem.CustomerNo = PrimaryKey;
            //delete the record
            AllCustomers.Delete();
            //now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
コード例 #7
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the item of test data
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.ID             = 1;
            TestItem.FullName       = "James May";
            TestItem.Address        = "East Street";
            TestItem.EmailAddress   = "*****@*****.**";
            TestItem.Above18        = true;
            TestItem.DateRegistered = DateTime.Now.Date;
            //set ThisCustomer to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //set the primary key of the test data
            TestItem.ID = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the record was found
            Assert.IsFalse(Found);
        }
コード例 #8
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the item of test data
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.customerActive    = true;
            TestItem.customerID        = 1;
            TestItem.customerUserName  = "******";
            TestItem.customerFirstName = "Dave";
            TestItem.customerlastName  = "Nut";
            TestItem.DateAdded         = DateTime.Now.Date;
            //set this customer to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //set the primary key of the test data
            TestItem.customerID = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
コード例 #9
0
    void DeleteCustomer()
    {
        clsCustomerCollection CustomerBook = new clsCustomerCollection();

        CustomerBook.ThisCustomer.Find(CustomerID);
        CustomerBook.Delete();
    }
コード例 #10
0
        public void DeleteMethodOK()
        {
            //create an instance of the class
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the item of test data
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.FirstName   = "Komal";
            TestItem.HouseNumber = "20";
            TestItem.DOB         = DateTime.Now.Date;
            TestItem.PhoneNo     = "07867543762";
            TestItem.PostCode    = "LE5 6HY";
            TestItem.StreetName  = "Star City";
            TestItem.Surname     = "Mukesh";
            //set ThisCustomer to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //set the primary key
            TestItem.CustomerID = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //now find tyhe record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
コード例 #11
0
        public void DeleteMethodOK()
        {
            // Create an instance of the class we want to create
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            // Create the item of test data
            clsCustomer TestItem = new clsCustomer();
            // var to store the primary key
            Int32 PrimaryKey = 0;

            // Set it's properties
            TestItem.IsCustomer          = true;
            TestItem.CustomerID          = 1;
            TestItem.FirstName           = "Jeff";
            TestItem.Surname             = "Jefferson";
            TestItem.AddressNo           = 12;
            TestItem.Address             = "Jeff Street";
            TestItem.PostCode            = "LE40RT";
            TestItem.Email               = "*****@*****.**";
            TestItem.AccountCreationDate = DateTime.Now.Date;
            TestItem.TotalSpent          = 4000;
            // Set ThisCustomer to the test data
            AllCustomers.ThisCustomer = TestItem;
            // Add the record
            PrimaryKey = AllCustomers.Add();
            //Set the primary key of the test data
            TestItem.CustomerID = PrimaryKey;
            //Find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            // Delete the record
            AllCustomers.Delete();
            // Now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
コード例 #12
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the item of test data
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.Active            = true;
            TestItem.CustomerID        = 1;
            TestItem.CustomerName      = "Jeff Adams";
            TestItem.CustomerTelNumber = "07896432654";
            TestItem.CustomerAddress   = "45 Leicester Street";
            TestItem.DateJoined        = DateTime.Now.Date;
            //set thisCustomer to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            // set the primary key of the test data
            TestItem.CustomerID = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
コード例 #13
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the item of testdata
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.ReceiveMail = true;
            TestItem.CustomerId  = 11;
            TestItem.Username    = "******";
            TestItem.Password    = "******";
            TestItem.DateOfBirth = DateTime.Now.Date;
            TestItem.Address     = "32 Stormy Lane";
            //set ThisCustomer to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //set the primary key of the test data
            TestItem.CustomerId = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
コード例 #14
0
ファイル: tstCustomerCollection.cs プロジェクト: kenny348/rtt
        public void DeleteMethodOK()
        {
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            clsCustomer           TestItem     = new clsCustomer();

            //TestItem.Active = true;
            TestItem.ProductNo   = 1;
            TestItem.PhoneNumber = "100000000000";
            TestItem.FullName    = "Bob Smith";
            TestItem.Email       = "*****@*****.**";
            TestItem.CustomerID  = 1;
            TestItem.Date        = DateTime.Now.Date;
            TestItem.Address     = "9 Hamilton Road LE5 J3D";
            TestItem.OrderNo     = 1;
            Int32 PrimaryKey = 1;

            AllCustomers.ThisCustomer = TestItem;
            PrimaryKey         = AllCustomers.Add();
            TestItem.ProductNo = PrimaryKey;
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            AllCustomers.Delete();
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
コード例 #15
0
        public void DeleteMethodOK()
        {
            //create an instance of the clsCustomerCollection class
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the item of test data
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.CustomerID         = 10;
            TestItem.Customerfirstname  = "Paul";
            TestItem.Customerlastname   = "Pogba";
            TestItem.Customerhouseno    = "6";
            TestItem.Customerstreetname = "Old Trafford";
            TestItem.Customercity       = "Manchester";
            TestItem.Customerpostcode   = "MU1 2FC";
            TestItem.Customerphoneno    = 17465389021;
            TestItem.Customeremail      = "*****@*****.**";
            //set ThisCustomer to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //Set the primary key of the test data
            TestItem.CustomerID = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the two values are the same
            Assert.IsFalse(Found);
        }
コード例 #16
0
        public void DeleteMethod()
        {
            //create and instance of the class
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the item of test data
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.CustomerID  = 1;
            TestItem.Name        = "Tommy";
            TestItem.Phone       = "0734642344";
            TestItem.Email       = "*****@*****.**";
            TestItem.Username    = "******";
            TestItem.Password    = "******";
            TestItem.PaymentType = "Debit Card";
            TestItem.SecurityMsg = "ball";
            //set ThisCustomer to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //set the primary key of the test data
            TestItem.CustomerID = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
コード例 #17
0
        public void DeleteMethodOK()
        {
            //Create an instance of the class
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the item of test data
            clsCustomer TestItem = new clsCustomer();
            //Var to store the primary key
            Int32 PrimaryKey = 0;

            //Set its properties
            TestItem.CustomerID         = 1;
            TestItem.CustomerAddress    = "20 Austen Avenue";
            TestItem.CustomerEmail      = "*****@*****.**";
            TestItem.CustomerFirstName  = "zad";
            TestItem.CustomerLastName   = "ali";
            TestItem.CustomerPostCodeOK = "NG7 6PE";
            TestItem.CustomerNumber     = "123456789";
            TestItem.ActiveOK           = true;
            TestItem.DateAddedOK        = DateTime.Now.Date;
            //set this repair to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //set the primary key of the test data
            TestItem.CustomerID = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //Delete the record
            AllCustomers.Delete();
            //Now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //Test to see if the two values are the same
            Assert.IsFalse(Found);
        }
コード例 #18
0
        public void DeleteMethodOK()
        {
            clsCustomerCollection AllCustomers = new clsCustomerCollection();

            clsCustomers TestItem = new clsCustomers();

            Int32 PrimaryKey = 0;

            TestItem.active      = true;
            TestItem.customer_id = 1;
            TestItem.first_name  = "Bilbo";
            TestItem.last_name   = "Baggins";
            TestItem.email       = "*****@*****.**";
            TestItem.create_date = DateTime.Now.Date;

            AllCustomers.ThisCustomer = TestItem;

            PrimaryKey = AllCustomers.Add();

            TestItem.customer_id = PrimaryKey;

            AllCustomers.ThisCustomer.Find(PrimaryKey);
            AllCustomers.Delete();

            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
コード例 #19
0
        public void DeleteCustomerID()
        {
            //create an instance of the class we want to create
            clsCustomerCollection ACustomer = new clsCustomerCollection();
            //create the item of test data
            clsCustomerDetails TestItem = new clsCustomerDetails();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.customerid   = 5;
            TestItem.username     = "******";
            TestItem.password     = "******";
            TestItem.firstname    = "Upesh";
            TestItem.lastname     = "Chavda";
            TestItem.emailaddress = "*****@*****.**";
            TestItem.mobilenumber = "07754885553";
            TestItem.cardnumber   = "02365153439";
            TestItem.secruitycode = "454";
            TestItem.expirydate   = DateTime.Now.Date;
            TestItem.addressName  = "44A";
            TestItem.streetname   = "Newarke Close";
            TestItem.cityname     = "Leicester";
            TestItem.postcode     = "LE2 7GZ";
            //set this ThisCustomer to the test data
            ACustomer.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = ACustomer.Add();
            //set the primary key of the test data
            TestItem.customerid = PrimaryKey;
            ACustomer.Delete();
            Boolean found = ACustomer.ThisCustomer.Find(PrimaryKey);

            Assert.IsFalse(found);
        }
コード例 #20
0
        public void DeleteMethodOK()
        {
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            clsCustomer           TestItem     = new clsCustomer();
            Int32 PrimaryKey = 0;

            TestItem.Username          = "******";
            TestItem.CustomerFirstName = "John";
            TestItem.CustomerLastName  = "Smith";
            TestItem.CustomerEmail     = "";
            TestItem.CustomerAddress   = "123 Some Street";
            TestItem.CustomerTelephone = "01163480420";
            AllCustomers.ThisCustomer  = TestItem;
            PrimaryKey = AllCustomers.Add();
            //assign the data to the property
            TestItem.CustomerID = PrimaryKey;
            //
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //
            AllCustomers.Delete();
            //test to see that the two values are the same
            bool Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //
            Assert.IsFalse(Found);
        }
コード例 #21
0
 public void DeleteMethodOK()
 {
     //create an instance of the class we want to create
     clsCustomerCollection AllCustomers = new clsCustomerCollection();
     //create the item of test data
     clsCustomer TestItem = new clsCustomer();
     //var to store the primary key
     Int32 PrimaryKey = 0;
     //set its properties
     TestItem.Active = true;
     TestItem.CustomerNo = 1;
     TestItem.Title = "Mr";
     TestItem.ForeName = "John";
     TestItem.LastName = "Smith";
     TestItem.Email = "*****@*****.**";
     TestItem.PhoneNo = 0123456789;
     TestItem.DateAdded = DateTime.Now.Date;
     //set ThisCustomer to the test data
     AllCustomers.ThisCustomer = TestItem;
     //add the record
     PrimaryKey = AllCustomers.Add();
     //set the primary key of the test data
     TestItem.CustomerNo = PrimaryKey;
     //find the record
     AllCustomers.ThisCustomer.Find(PrimaryKey);
     //delete the record
     AllCustomers.Delete();
     //now find the record
     Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);
     //test to see that the two values are the same
     Assert.AreEqual(AllCustomers.ThisCustomer, TestItem);
 }
コード例 #22
0
 public void DeleteMethodOK()
 {
     //create an instanceof the clas we watn to create
     clsCustomerCollection AllCustomers = new clsCustomerCollection();
     //create the item of test data
     clsCustomer TestItem = new clsCustomer();
     //var to streo the primary key
     Int32 PrimaryKey = 0;
     //set its properties
     TestItem.Active = true;
     TestItem.CustomerID = 1;
     TestItem.CustomerFirstName = "First";
     TestItem.CustomerLastName = "Last";
     TestItem.CustomerEmail = "*****@*****.**";
     TestItem.CustomerTeleNo = "XXXXXXXXXX";
     //set thiscustomer to thetest data
     AllCustomers.ThisCustomer = TestItem;
     //add the record
     PrimaryKey = AllCustomers.Add();
     //find the record
     TestItem.CustomerID = PrimaryKey;
     AllCustomers.ThisCustomer.Find(PrimaryKey);
     //delete the record
     AllCustomers.Delete();
     //now find the record
     Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);
     //test to see that the record was not found
     Assert.IsFalse(Found);
 }
コード例 #23
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsCustomerCollection AllCustomer = new clsCustomerCollection();
            //create the item of test data
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 Primarykey = 0;

            //set its properties
            TestItem.Membership   = true;
            TestItem.CustomerID   = 7;
            TestItem.FirstName    = "Roshni";
            TestItem.LastName     = "Tandel";
            TestItem.Address      = "34 Belper Street Leicester LE6 7HG";
            TestItem.MobileNumber = 074586456;
            TestItem.Date         = Convert.ToDateTime("17/02/1993");
            //set ThisCustomer to the test data
            AllCustomer.ThisCustomer = TestItem;
            //add the record
            Primarykey = AllCustomer.Add();
            //set the primary key of the test data
            TestItem.CustomerID = Primarykey;
            //find the record
            AllCustomer.Delete();
            //noe find the record
            Boolean Found = AllCustomer.ThisCustomer.Find(Primarykey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
コード例 #24
0
        public void DeleteMethodOk()
        {
            //create an instance of the class we want to create
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the intem of test data
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.CustomerID    = 2;
            TestItem.Active        = false;
            TestItem.Name          = "John Smith";
            TestItem.Address       = "26 High Street";
            TestItem.PostCode      = "LE3 1JK";
            TestItem.ContactNumber = "07986543211";
            TestItem.EmailAddress  = "*****@*****.**";
            TestItem.DateJoined    = DateTime.Now.Date;
            //set thiscustomer to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //set the primary key of the test data
            TestItem.CustomerID = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
コード例 #25
0
        public void DeleteMethodOK()
        {
            clsCustomerCollection AllCustomers = new clsCustomerCollection();

            ClsCustomer TestItem = new ClsCustomer();
            Name        cName    = new Name("Dale", "Doback");

            Int32 PrimaryKey = 0;

            TestItem.CustomerID   = 1;
            TestItem.CustomerName = cName;
            TestItem.DateOfBirth  = DateTime.Now.Date;
            TestItem.Email        = "*****@*****.**";
            TestItem.PhoneNumber  = "00009278362";
            TestItem.Password     = "******";
            TestItem.CardNo       = "0202983729182916";
            TestItem.CardDate     = DateTime.Now.Date;

            AllCustomers.ThisCustomer = TestItem;

            PrimaryKey = AllCustomers.Add();

            TestItem.CustomerID = PrimaryKey;

            AllCustomers.ThisCustomer.Find(PrimaryKey);

            AllCustomers.Delete();

            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            Assert.AreEqual(AllCustomers.ThisCustomer, TestItem);
        }
コード例 #26
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create the item of test data
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.Active       = true;
            TestItem.CustomerID   = 21;
            TestItem.FirstName    = "Ryan";
            TestItem.LastName     = "Fretwell";
            TestItem.Address      = "Somewhere";
            TestItem.PostCode     = "LE30EB";
            TestItem.PhoneNumber  = "07775734887";
            TestItem.EmailAddress = "*****@*****.**";
            TestItem.DateAdded    = DateTime.Now.Date;
            //set ThisCustomer to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add the record
            PrimaryKey = AllCustomers.Add();
            //set the primary key of the test data
            TestItem.CustomerID = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the two values are the same
            Assert.IsFalse(Found);
        }
コード例 #27
0
        public void DeleteMethodOK()
        {
            //create an insance of the class we want to create
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create this item of test data
            clsCustomer TestItem = new clsCustomer();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.CustomerID        = 25;
            TestItem.CustomerFirstName = "Carl";
            TestItem.CustomerLastName  = "Pagulayan";
            TestItem.Email             = "*****@*****.**";
            TestItem.TelephoneNo       = "07123456789";
            TestItem.Address1          = "10 Bishops Court";
            TestItem.Address2          = "Haverhill";
            TestItem.PostCode          = "CB9 9BS";
            TestItem.CustomerPassword  = "******";
            //set ThisCustomer to the test data
            AllCustomers.ThisCustomer = TestItem;
            //add teh record
            PrimaryKey = AllCustomers.Add();
            //set the primary key of the test data
            TestItem.CustomerID = PrimaryKey;
            //find the record
            AllCustomers.ThisCustomer.Find(PrimaryKey);
            //delete the record
            AllCustomers.Delete();
            //now find the record
            Boolean Found = AllCustomers.ThisCustomer.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
コード例 #28
0
ファイル: DeleteCustomer.aspx.cs プロジェクト: kenny348/rtt
    protected void btnYes_Click(object sender, EventArgs e)
    {
        clsCustomerCollection CustomerBook = new clsCustomerCollection();

        CustomerBook.ThisCustomer.Find(ProductNo);
        CustomerBook.Delete();
        Response.Redirect("CustomerList.aspx");
    }
コード例 #29
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        clsCustomerCollection CustomerTable = new clsCustomerCollection();

        CustomerTable.ThisCustomer.Find(CustomerID);
        CustomerTable.Delete();
        Response.Redirect("CustomerList.aspx");
    }
コード例 #30
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        clsCustomerCollection Customers = new clsCustomerCollection();

        Customers.ThisCustomer.Find(CustomerId);
        Customers.Delete();
        Response.Redirect("CustomerList.aspx");
    }