예제 #1
0
        public void Test_CreateUpdateDeleteProfileImageFile()
        {
            IUserBasic userBasic = Test_WorkmateMembershipProvider.CreateUser(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.DummyDataManager);

            ProfileImageManager manager = new ProfileImageManager(this.DataStore);
            ProfileImage        record  = Test_ProfileImages.CreateProfileImage(this.DataStore, this.Application.ApplicationId, userBasic, this.Random);

            ProfileImage recordToCompare;

            for (int i = 0; i < this.DefaultUpdateTestIterations; i++)
            {
                PopulateWithRandomValues(record, this.DummyDataManager, this.Random);
                recordToCompare = record;

                manager.Update(record);
                record = manager.GetProfileImage(record.ImageId);

                string errors = string.Empty;
                // TODO (Roman): relax datetime comparisons
                Assert.IsTrue(DebugUtility.ArePropertyValuesEqual(record, recordToCompare, out errors), errors);
                Trace.WriteLine("Update test successfull.");
            }

            Delete(this.DataStore, record);
        }
예제 #2
0
        public void Test_AssignNewProfileImage()
        {
            IUserBasic userBasic = Test_WorkmateMembershipProvider.CreateUser(this.DataStore, Workmate.Components.InstanceContainer.ApplicationSettings, this.Application, this.DummyDataManager);

            ProfileImageManager manager = new ProfileImageManager(this.DataStore);
            ProfileImage        record  = Test_ProfileImages.CreateProfileImage(this.DataStore, this.Application.ApplicationId, userBasic, this.Random);

            ProfileImage record2 = Test_ProfileImages.CreateProfileImage(this.DataStore, this.Application.ApplicationId, userBasic, this.Random);

            Assert.IsNull(manager.GetProfileImage(record.ImageId));

            Delete(this.DataStore, record2);
        }