예제 #1
0
        public void ShouldUpdatePhoto()
        {
            //arrange
            var user = GenerateUser();

            //act
            var dataLayer = new DataLayer.Sql.DataLayer(ConnectionSql);

            dataLayer.AddUser(user);

            var photo = GeneratePhoto(user.Id);

            dataLayer.AddPhoto(photo);

            var photoUpdate = GeneratePhoto(user.Id);

            dataLayer.UpdatePhoto(photo.Id, photoUpdate);
            photoUpdate = dataLayer.GetPhoto(photo.Id);

            var resUser = dataLayer.GetPhoto(photo.Id);

            //assert
            Assert.AreEqual(resUser.Id, photoUpdate.Id);
        }