Ejemplo n.º 1
0
        public void UpdatePageStory_WhenProvidedCredentialsAndValidPage_PostsUpdate(WireDataFormat format)
        {
            var client = TestContext.CreateClientValidCredentials(format);
            var pageClient = new PageApi(client.HttpChannel);

            // Create Page
            var pageShortName = "api-test-" + Guid.NewGuid();
            var pageCreationRequest = new RegisterPageRequest
            {
                ActivityType = ActivityType.OtherCelebration,
                PageShortName = pageShortName,
                PageTitle = "Page Created For Update Story Integration Test",
                EventName = "Story Update Testing",
                CharityId = 2050,
                TargetAmount = 20M,
                EventDate = DateTime.Now.AddDays(5)
            };

            pageClient.Create(pageCreationRequest);

            // Act
            var update = DateTime.Now + ": Unit Test Update";
            pageClient.UpdateStory(pageCreationRequest.PageShortName, update);

            // Assert
            var pageData = pageClient.Retrieve(pageShortName);
            Assert.That(pageData.Story, Is.StringContaining(update));
        }