Ejemplo n.º 1
0
        private async Task ValidateRfi(Rfi rfi, IPlanGridApi client)
        {
            Page <RfiChange> history = await client.GetRfiHistory(TestData.Project1Uid, rfi.Uid);

            Assert.AreEqual("locked", history.Data[0].Field);
            Assert.AreEqual(true, (bool)history.Data[0].NewValue);
            Assert.AreEqual(false, (bool)history.Data[0].OldValue);

            Assert.AreEqual("Test Rfi Answer", rfi.Answer);
            Assert.AreEqual("Test Rfi Question", rfi.Question);
            Assert.AreEqual("Test Rfi", rfi.Title);
            Assert.AreEqual(1, rfi.Number);
            Assert.AreEqual(DateTime.Parse("2015/11/18 19:30:21.000"), rfi.SentAt);
            Assert.AreEqual(DateTime.Parse("2015/11/19 19:30:13.000"), rfi.DueAt);
            Assert.AreEqual(DateTime.Parse("11/17/2015 20:06:48.115"), rfi.UpdatedAt);
            Assert.AreEqual(DateTime.Parse("11/16/2015 21:48:26.641"), rfi.CreatedAt);
            Assert.AreEqual("*****@*****.**", rfi.AssignedTo[0].Email);
            Assert.AreEqual("*****@*****.**", rfi.UpdatedBy.Email);
            Assert.AreEqual("*****@*****.**", rfi.CreatedBy.Email);
            Assert.IsFalse(string.IsNullOrEmpty(rfi.Uid));
            Assert.IsTrue(rfi.IsLocked);

            Page <Photo> photos = await client.Resolve(rfi.Photos);

            Assert.AreEqual(1, rfi.Photos.TotalCount);
            Assert.AreEqual(1, photos.TotalCount);
            Assert.AreEqual(TestData.PhotoUrl, photos.Data[0].Url);

            Page <Snapshot> snapshots = await client.Resolve(rfi.Snapshots);

            Assert.AreEqual(1, rfi.Snapshots.TotalCount);
            Assert.AreEqual(1, snapshots.TotalCount);
            Assert.AreEqual("AR.1", snapshots.Data[0].Title);

            Page <Attachment> attachments = await client.Resolve(rfi.Attachments);

            Assert.AreEqual(1, rfi.Attachments.TotalCount);
            Assert.AreEqual(1, attachments.TotalCount);
            Assert.AreEqual("PA1.11.pdf", attachments.Data[0].Name);

            Page <Comment> comments = await client.Resolve(rfi.Comments);

            Assert.AreEqual(1, rfi.Comments.TotalCount);
            Assert.AreEqual(1, comments.TotalCount);
            Assert.AreEqual("Test Rfi Comment", comments.Data[0].Text);
        }
Ejemplo n.º 2
0
        private async Task ValidateRfi(Rfi rfi, IPlanGridApi client)
        {
            Page<RfiChange> history = await client.GetRfiHistory(TestData.Project1Uid, rfi.Uid);
            Assert.AreEqual("locked", history.Data[0].Field);
            Assert.AreEqual(true, (bool)history.Data[0].NewValue);
            Assert.AreEqual(false, (bool)history.Data[0].OldValue);

            Assert.AreEqual("Test Rfi Answer", rfi.Answer);
            Assert.AreEqual("Test Rfi Question", rfi.Question);
            Assert.AreEqual("Test Rfi", rfi.Title);
            Assert.AreEqual(1, rfi.Number);
            Assert.AreEqual(Date.Parse("2015-11-18"), rfi.SentDate);
            Assert.AreEqual(Date.Parse("2015-11-19"), rfi.DueDate);
            Assert.AreEqual(DateTime.Parse("11/17/2015 20:06:47.912"), rfi.UpdatedAt);
            Assert.AreEqual(DateTime.Parse("11/16/2015 21:48:26.641"), rfi.CreatedAt);
            Assert.AreEqual("*****@*****.**", rfi.AssignedTo[0].Email);
            Assert.AreEqual("*****@*****.**", rfi.UpdatedBy.Email);
            Assert.AreEqual("*****@*****.**", rfi.CreatedBy.Email);
            Assert.IsFalse(string.IsNullOrEmpty(rfi.Uid));
            Assert.IsTrue(rfi.IsLocked);

            Page<Photo> photos = await client.Resolve(rfi.Photos);
            Assert.AreEqual(1, rfi.Photos.TotalCount);
            Assert.AreEqual(1, photos.TotalCount);
            Assert.AreEqual(TestData.PhotoUrl, photos.Data[0].Url);

            Page<Snapshot> snapshots = await client.Resolve(rfi.Snapshots);
            Assert.AreEqual(1, rfi.Snapshots.TotalCount);
            Assert.AreEqual(1, snapshots.TotalCount);
            Assert.AreEqual("AR.1", snapshots.Data[0].Title);

            Page<Attachment> attachments = await client.Resolve(rfi.Attachments);
            Assert.AreEqual(1, rfi.Attachments.TotalCount);
            Assert.AreEqual(1, attachments.TotalCount);
            Assert.AreEqual("PA1.11.pdf", attachments.Data[0].Name);

            Page<Comment> comments = await client.Resolve(rfi.Comments);
            Assert.AreEqual(1, rfi.Comments.TotalCount);
            Assert.AreEqual(1, comments.TotalCount);
            Assert.AreEqual("Test Rfi Comment", comments.Data[0].Text);
        }