Exemple #1
0
        public async Task GetReturnsStoredPhotoForProfileIdentityTest()
        {
            var account = Model.UsingBuildStrategy <ProfileBuildStrategy>().Create <Account>();
            var profile = await Model.UsingBuildStrategy <ProfileBuildStrategy>().Create <Profile>().ClearCategories()
                          .Save(_logger, account).ConfigureAwait(false);

            var identity = ClaimsIdentityFactory.Build(account, profile);
            var address  = ApiLocation.AccountProfilePhotos;
            var expected = Resources.photo;

            var result = await Client.PostFile <PhotoDetails>(address, _logger, expected, identity)
                         .ConfigureAwait(false);

            var details = result.Item2;

            var location = ApiLocation.PhotoFor(details);

            var actual = await Client.Get <byte[]>(location, _logger, identity).ConfigureAwait(false);

            actual.SequenceEqual(expected).Should().BeTrue();
        }