コード例 #1
0
        public void GetProfile_returns_chase_and_makenna()
        {
            var actual = new UserProfileService().GetProfile();

            var expectedChase   = UserProfileData.ChaseProfile();
            var expectedMakenna = UserProfileData.MakennaProfile();
            var actualChase     = actual.First(x => x.Id == expectedChase.Id);
            var actualMakenna   = actual.First(x => x.Id == expectedMakenna.Id);

            Assert.AreEqual(2, actual.Count());

            Assert.AreEqual(expectedChase.Id, actualChase.Id);
            Assert.AreEqual(expectedChase.FirstName, actualChase.FirstName);
            Assert.AreEqual(expectedChase.LastName, actualChase.LastName);
            Assert.AreEqual(expectedChase.AccessToken, actualChase.AccessToken);

            Assert.AreEqual(expectedMakenna.Id, actualMakenna.Id);
            Assert.AreEqual(expectedMakenna.FirstName, actualMakenna.FirstName);
            Assert.AreEqual(expectedMakenna.LastName, actualMakenna.LastName);
            Assert.AreEqual(expectedMakenna.AccessToken, actualMakenna.AccessToken);
        }
コード例 #2
0
 protected override void Seed(GroceryHubEntity context)
 {
     context.UserProfiles.AddOrUpdate(x => x.Id,
                                      UserProfileData.ChaseProfile(),
                                      UserProfileData.MakennaProfile());
 }