Exemplo n.º 1
0
        private async Task <Profile> CreateTestProfile()
        {
            var profile = Profile.Create(new CreateProfileRequest
            {
                UserId      = userId,
                Username    = "******",
                Bio         = "bio",
                DisplayName = "Test Profile",
                ImageUrl    = "ImageUrl"
            });

            await this.unitOfWork.Profiles.Create(profile);

            await this.unitOfWork.SaveAsync();

            return(profile);
        }
        public async Task Given_A_New_Profile__When_Creating_Profile__UnitOfWork_Returns_Correct_Profile_Data()
        {
            // Arrange
            var profile = Profile.Create(new CreateProfileRequest()
            {
                UserId      = userId,
                Username    = "******",
                DisplayName = "Display Name",
                Bio         = "Bio",
                ImageUrl    = "link"
            });

            // Act
            var createdProfile = await this.unitOfWork.Profiles.Create(profile);

            await this.unitOfWork.SaveAsync();

            // Assert
            Assert.AreEqual(profile.Username, createdProfile.Username);
            Assert.AreEqual(profile.Bio, createdProfile.Bio);
            Assert.AreEqual(profile.ImageUrl, createdProfile.ImageUrl);
        }