Ejemplo n.º 1
0
 public void GetsProfileCount()
 {
     SetupFakeWithDb();
     profileData.Add("*****@*****.**", new DiscreteExercisePlan(true));
     Assert.That(profileData.GetCount(), Is.EqualTo(2));
     profileData.Add("*****@*****.**", new DiscreteExercisePlan(true));
     Assert.That(profileData.GetCount(), Is.EqualTo(3));
 }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }