示例#1
0
    public void AddReviewContent()
    {
        ServiceGateway.ReviewDto dto =
            gateway.AddReview(reviewerName, reviewContent, rating, Recording.Id);

        Assert.AreEqual(reviewerName, dto.reviewerName);
        Assert.AreEqual(reviewContent, dto.reviewContent);
        Assert.AreEqual(rating, dto.rating);

        gateway.DeleteReview(dto.id);
    }
示例#2
0
    public void ReviewAddedToRecording()
    {
        int beforeCount = Recording.GetReviews().Length;

        ServiceGateway.ReviewDto dto =
            gateway.AddReview(reviewerName, reviewContent, rating, Recording.Id);

        ServiceGateway.RecordingDto recordingDto = gateway.FindByRecordingId(Recording.Id);
        Assert.AreEqual(beforeCount + 1, recordingDto.reviews.Length);

        gateway.DeleteReview(dto.id);
    }
示例#3
0
    public void ReviewDeletedFromRecording()
    {
        ServiceGateway.RecordingDto recordingDto =
            gateway.FindByRecordingId(Recording.Id);
        Assert.IsNull(recordingDto.reviews);

        ServiceGateway.ReviewDto dto =
            gateway.AddReview(reviewerName, reviewContent, rating, Recording.Id);
        gateway.DeleteReview(dto.id);

        recordingDto = gateway.FindByRecordingId(Recording.Id);
        Assert.IsNull(recordingDto.reviews);
    }
示例#4
0
        public override void CustomizeRecording()
        {
            gateway = new CatalogGateway();

            review = gateway.AddReview(reviewerName, reviewContent, rating, Recording.Id);

            try
            {
                gateway.AddReview(reviewerName, reviewContent, rating, Recording.Id);
            }
            catch (SoapException exception)
            {
                soapException = exception;
            }
        }
示例#5
0
    public new void SetUp()
    {
        base.SetUp();

        gateway = new CatalogGateway();

        review = gateway.AddReview(reviewerName, reviewContent, rating, Recording.Id);

        try
        {
            gateway.AddReview(reviewerName, reviewContent, rating, Recording.Id);
        }
        catch (SoapException exception)
        {
            soapException = exception;
        }
    }