Example #1
0
        public async Task ReferencePhoto()
        {
            IPlanGridApi client    = PlanGridClient.Create();
            var          rfiInsert = new RfiUpsert
            {
                Question   = "test question",
                Answer     = "test answer",
                AssignedTo = new[] { TestData.ApiTestsUserUid },
                DueAt      = new DateTime(2020, 1, 1),
                IsLocked   = false,
                SentAt     = new DateTime(2019, 1, 1),
                StatusUid  = TestData.Project2DraftRfiStatusUid,
                Title      = "test title"
            };
            Rfi rfi = await client.CreateRfi(TestData.Project2Uid, rfiInsert);

            await client.ReferencePhotoFromRfi(TestData.Project2Uid, rfi.Uid, new PhotoReference { PhotoUid = TestData.Project2PhotoUid });

            Page <Photo> photos = await client.GetRfiPhotos(TestData.Project2Uid, rfi.Uid);

            Photo rfiPhoto = photos.Data.Single();

            Assert.AreEqual(TestData.Project2PhotoUid, rfiPhoto.Uid);

            await client.RemovePhotoFromRfi(TestData.Project2Uid, rfi.Uid, rfiPhoto.Uid);

            photos = await client.GetRfiPhotos(TestData.Project2Uid, rfi.Uid);

            Assert.AreEqual(0, photos.Data.Length);
        }
Example #2
0
        public async Task GetRfiPhotos()
        {
            IPlanGridApi client = PlanGridClient.Create();
            Page <Photo> photos = await client.GetRfiPhotos(TestData.Project1Uid, TestData.Project1Rfi1Uid);

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