示例#1
0
        public void ListFriendsUsingMapper()
        {
            var mappingFriendRepository = new MappingFriendRepository();
            var testUserId = Guid.Empty;

            using (var context = new aspnetdbEntities())
            {
                testUserId = context.aspnet_Membership.FirstOrDefault().UserId;
            }

            var result = mappingFriendRepository.ListFriendsOfUser(testUserId);

            Assert.IsInstanceOfType(result.FirstOrDefault(), typeof(Core.Models.Friend));
        }
        public void ListFriendsUsingMapper()
        {
            var friendRepository = new MappingFriendRepository();

            var context =new PluralSightBook.Data.PluralSightBookContext();
            var initializer = new TestDbInitializer();
            initializer.Reseed(context);

            var testUserId = context.Users.FirstOrDefault().UserId;
            friendRepository.Create(testUserId, "*****@*****.**");
            var result = friendRepository.ListFriendsOfUser(testUserId);

            Assert.IsInstanceOfType(result.FirstOrDefault(), typeof(PluralSightBook.Core.Model.Friend));
        }