Example #1
0
        //[ExpectedException(typeof(ReviewDataException))]
        public void DELETE_IMMEDIATELY()
        {
            var review = Review.CreateNew();

            review.DeleteImmediately();
            Review.GetReview(review.Id);
        }
Example #2
0
        public void UPDATE()
        {
            var review = Review.CreateNew();

            review.Comments = _TestComments;
            review.Update();
        }
Example #3
0
        public void COMMIT()
        {
            var review = Review.CreateNew();

            review.Comments = _TestComments;
            Review updatedReview = (Review)review.Commit();
            Review gottenReview  = Review.GetReview(updatedReview.Id);

            Assert.AreEqual(review.Comments, gottenReview.Comments);
        }
Example #4
0
        public void TO_DTO()
        {
            //HACK: ReviewTests.TO_DTO: I'm not sure if I should new up or touch DB using CreateNew().  Right now, I'm touching the DB.
            var review = Review.CreateNew();

            review.Comments   = _TestComments;
            review.Rating     = _TestRating;
            review.CustomerId = _TestCustomerId;

            var dto = review.ToDto();

            Assert.AreEqual(review.Comments, dto.Comments);
            Assert.AreEqual(review.Rating, dto.Rating);
            Assert.AreEqual(review.CustomerId, dto.CustomerId);
        }
Example #5
0
        public void PROPERTYCHANGED_TRIGGERED()
        {
            int countChangesRaised = 0;
            var review             = Review.CreateNew();

            review.PropertyChanged += (s, e) =>
            {
                countChangesRaised++;
            };
            //1
            review.Rating = 4;
            //2
            review.Comments = "sdiuweifjskdjfoijwef";

            int numPropsChanged = 2;

            Assert.AreEqual(numPropsChanged, countChangesRaised);
        }
Example #6
0
        public void LOAD_FROM_DTO()
        {
            //HACK: ReviewTests.LOAD_FROM_DTO: I'm not sure if I should new up or touch DB using CreateNew().  Right now, I'm touching the DB.
            var dto = new ReviewDto();

            dto.Comments = _TestComments;
            dto.Rating   = _TestRating;
            var cust = Customer.CreateNew();

            dto.CustomerId = cust.Id;


            var review = Review.CreateNew();

            review.LoadFromDto(dto);

            Assert.AreEqual(dto.Comments, review.Comments);
            Assert.AreEqual(dto.Rating, review.Rating);
            Assert.AreEqual(dto.CustomerId, review.CustomerId);
        }
Example #7
0
        public void GET()
        {
            var review = Review.CreateNew();

            review = Review.GetReview(review.Id);
        }
Example #8
0
 public void CREATE_NEW()
 {
     var review = Review.CreateNew();
 }