コード例 #1
0
        //Gives you a fake in memory db with a fake profile ready to go.
        public void SetupFakeWithDb()
        {
            profileData = new SqlProfileData(FitnessTrackerDbContext.MockDBContextFactory());
            fakeNewProfile();

            //Act
            profileData.Add(fakeProfile);
        }
コード例 #2
0
        public void AddingProfileByElements_ProfileInDBset()
        {
            //Arrange
            profileData = new SqlProfileData(FitnessTrackerDbContext.MockDBContextFactory());

            fakeProfile = new FitnessProfile();
            var discExcPlans = new List <DiscreteExercisePlan>();

            discExcPlans.Add(new DiscreteExercisePlan(true));

            fakeProfile.DiscreteExercisePlans = discExcPlans;

            //Act
            profileData.Add(testEmail, new DiscreteExercisePlan(true));

            //Assert
            var addResult = profileData.db.UserProfiles.Find(testEmail);

            Assert.That(addResult, Is.Not.Null);
        }