public void UpdateMethodOK()
        {
            clsReviewCollection AllReviews = new clsReviewCollection();;
            clsReview           TestItem   = new clsReview();
            Int32 PrimaryKey = 0;

            TestItem.VerifiedCustomer = true;
            TestItem.ReviewID         = 7;
            TestItem.CustomerID       = 6;
            TestItem.ProductID        = 1;
            TestItem.ReviewDate       = DateTime.Now.Date;
            TestItem.ProductRating    = 4;
            TestItem.Review           = "Amazing product, would recommend to all students!";

            AllReviews.ThisReview = TestItem;
            PrimaryKey            = AllReviews.Add();
            TestItem.ReviewID     = PrimaryKey;

            TestItem.VerifiedCustomer = false;
            TestItem.ReviewID         = 9;
            TestItem.CustomerID       = 5;
            TestItem.ProductID        = 3;
            TestItem.ReviewDate       = DateTime.Now.Date;
            TestItem.ProductRating    = 5;
            TestItem.Review           = "PHENOMENAL product!!!!";
            AllReviews.ThisReview     = TestItem;
            AllReviews.Update();

            AllReviews.ThisReview.Find(PrimaryKey);
            Assert.AreEqual(AllReviews.ThisReview, TestItem);
        }
Exemple #2
0
        public void InstanceOK()

        {
            clsReview anReview = new clsReview();

            Assert.IsNotNull(anReview);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        clsReview Review = new clsReview();

        Review = (clsReview)Session["Review"];
        Response.Write(Review.ReviewID);
    }
Exemple #4
0
        public void ReviewDateExists()
        {
            clsReview AReview  = new clsReview();
            DateTime  TestData = DateTime.Now.Date;

            AReview.ReviewDate = TestData;
            Assert.AreEqual(AReview.ReviewDate, TestData);
        }
Exemple #5
0
        public void ProductRating()
        {
            clsReview AReview  = new clsReview();
            Int32     TestData = 1;

            AReview.ProductRating = TestData;
            Assert.AreEqual(AReview.ProductRating, TestData);
        }
        public void IsComplaintRecorded()
        {
            clsReview  aReview  = new clsReview();
            const bool testData = true;

            aReview.IsComplaintRecorded = testData;
            AssertEquals(aReview.IsComplaintRecorded, testData);
        }
        public void DatePublishedOk()
        {
            clsReview aReview  = new clsReview();
            DateTime  testData = DateTime.Now.Date;

            aReview.datePublished = testData;
            AssertEquals(aReview.datePublished, testData);
        }
        public void ReviewTitleOk()
        {
            clsReview aReview  = new clsReview();
            string    testData = "test data";

            aReview.reviewTitle = testData;
            Assert.AreEqual(aReview.reviewTitle, testData);
        }
        public void ReviewTextOk()
        {
            clsReview aReview  = new clsReview();
            string    testData = "test data";

            aReview.ReviewText = testData;
            Assert.AreEqual(aReview.ReviewText, testData);
        }
        public void CustomerIdOk()
        {
            clsReview aReview  = new clsReview();
            Int32     testData = 1;

            aReview.CustomerId = testData;
            Assert.AreEqual(aReview.CustomerId, testData);
        }
        public void ReviewIdOk()
        {
            clsReview aReview  = new clsReview();
            int       testData = 1;

            aReview.ReviewId = testData;
            Assert.AreEqual(aReview.ReviewId, testData);
        }
Exemple #12
0
        public void InstanceOK()
        {
            //create an instance of the class we want to create
            clsReview AnReview = new clsReview();

            //test to see that it exists
            Assert.IsNotNull(AnReview);
        }
Exemple #13
0
        public void ValidMethodOK()
        {
            clsReview AReview = new clsReview();
            String    Error   = "";

            Error = AReview.Valid(reviewdate, product, customer, review, productrating);
            Assert.AreEqual(Error, "");
        }
Exemple #14
0
        public void ReviewID()
        {
            clsReview AReview  = new clsReview();
            Int32     TestData = 1;

            AReview.ReviewID = TestData;
            Assert.AreEqual(AReview.ReviewID, TestData);
        }
Exemple #15
0
        public void Review()
        {
            clsReview AReview  = new clsReview();
            string    TestData = "Unique approach to stability. Guide rails provide dynamic support that give a smooth ride. Breathable upper.Rediculously comfortable for running and walking.";

            AReview.Review = TestData;
            Assert.AreEqual(AReview.Review, TestData);
        }
Exemple #16
0
        public void VerifedCustomer()
        {
            clsReview AReview  = new clsReview();
            Boolean   TestData = true;

            AReview.VerifiedCustomer = TestData;
            Assert.AreEqual(AReview.VerifiedCustomer, TestData);
        }
Exemple #17
0
        public void ProductRatingMaxPlusOne()
        {
            clsReview AReview       = new clsReview();
            String    Error         = "";
            string    productrating = "6";

            Error = AReview.Valid(reviewdate, product, customer, review, productrating);
            Assert.AreNotEqual(Error, "");
        }
Exemple #18
0
        public void ProductIDExtremeMax()
        {
            clsReview AReview = new clsReview();
            String    Error   = "";
            string    product = "99999999";

            Error = AReview.Valid(reviewdate, product, customer, review, productrating);
            Assert.AreNotEqual(Error, "");
        }
Exemple #19
0
        public void ProductIDMid()
        {
            clsReview AReview = new clsReview();
            String    Error   = "";
            string    product = "50000";

            Error = AReview.Valid(reviewdate, product, customer, review, productrating);
            Assert.AreEqual(Error, "");
        }
Exemple #20
0
        public void ReviewDateInvalidData()
        {
            clsReview AReview    = new clsReview();
            String    Error      = "";
            string    reviewdate = "this is not a date!";

            Error = AReview.Valid(reviewdate, product, customer, review, productrating);
            Assert.AreNotEqual(Error, "");
        }
Exemple #21
0
        public void ReviewMinPlusOne()
        {
            clsReview AReview = new clsReview();
            String    Error   = "";
            string    review  = "aa";

            Error = AReview.Valid(reviewdate, product, customer, review, productrating);
            Assert.AreEqual(Error, "");
        }
Exemple #22
0
        public void CustomerIDMax()
        {
            clsReview AReview  = new clsReview();
            String    Error    = "";
            string    customer = "99999";

            Error = AReview.Valid(reviewdate, product, customer, review, productrating);
            Assert.AreEqual(Error, "");
        }
    protected void btnOk_Click(object sender, EventArgs e)
    {
        clsReview aReview = new clsReview();

        aReview.ReviewId      = int.Parse(txtCustomerReview.Text);
        aReview.reviewTitle   = txtReviewTitle.Text;
        aReview.ReviewText    = txtReviewText.Text;
        aReview.datePublished = Convert.ToDateTime(calendar.SelectedDate);
    }
Exemple #24
0
        public clsReview DeserializeReview(string pstringData)
        {
            clsReview Review = new clsReview();
            dynamic   data   = JObject.Parse(pstringData);

            Review = JsonConvert.DeserializeObject <clsReview>(Convert.ToString(data));

            return(Review);
        }
Exemple #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //create new instance of clsReview
        clsReview aReview = new clsReview();

        //get the data from the session object
        aReview = (clsReview)Session["aReview"];
        Response.Write(aReview);
    }
Exemple #26
0
        public void StarRatingOK()
        {
            clsReview AnReview = new clsReview();

            Int32 TestData = 5;

            AnReview.Star = TestData;

            Assert.AreEqual(AnReview.Star, TestData);
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            clsReview AReview = new clsReview();

            AReview.ReviewId = -1;
            ReviewAddForm RA = new ReviewAddForm();

            this.Hide();
            RA.ShowDialog();
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        //create an instance of clsReview
        clsReview AnReview = new clsReview();

        //get the data from the session object
        AnReview = (clsReview)Session["AnReview"];
        //display the Reviewer name for this entry
        Response.Write(AnReview.ReviewerName);
    }
Exemple #29
0
        public void ReviewerNameOK()
        {
            clsReview AnReview = new clsReview();

            string TestData = "Fred";

            AnReview.ReviewerName = TestData;

            Assert.AreEqual(AnReview.ReviewerName, TestData);
        }
Exemple #30
0
        public void WouldUseAgainOK()
        {
            clsReview AnReview = new clsReview();

            Boolean TestData = false;

            AnReview.WouldUse = TestData;

            Assert.AreEqual(AnReview.Active, TestData);
        }