public void CanCreateNewFriend() { Guid testUserId; using (var context = new aspnetdbEntities()) { testUserId = context.aspnet_Membership.FirstOrDefault().UserId; } var friend = ActiveRecordFriend.CreateNew("*****@*****.**", testUserId); Assert.IsNotNull(friend); }
public void CanCreateExistingFriend() { Guid testUserId; using (var context = new Entities()) { testUserId = context.Memberships.FirstOrDefault().UserId; } var friend = ActiveRecordFriend.CreateNew("*****@*****.**", testUserId); var secondFriend = new ActiveRecordFriend(friend.Id); Assert.IsNotNull(secondFriend); }
public void EmailDomainReturnedCorrectly() { Guid testUserId; using (var context = new aspnetdbEntities()) { testUserId = context.aspnet_Membership.FirstOrDefault().UserId; } var friend = ActiveRecordFriend.CreateNew("*****@*****.**", testUserId); var domain = friend.EmailDomain; Assert.AreEqual("foo.com", domain); }
public void CanSaveChangesToFriend() { Guid testUserId; using (var context = new Entities()) { testUserId = context.Memberships.FirstOrDefault().UserId; } var friend = ActiveRecordFriend.CreateNew("*****@*****.**", testUserId); var secondFriend = new ActiveRecordFriend(friend.Id); secondFriend.EmailAddress = "updated"; secondFriend.Save(); var thirdFriend = new ActiveRecordFriend(friend.Id); Assert.AreEqual(secondFriend.EmailAddress, thirdFriend.EmailAddress); }
public void CanSaveChangesToFriend() { Guid testUserId; using (var context = new aspnetdbEntities()) { testUserId = context.aspnet_Membership.FirstOrDefault().UserId; } var friend = ActiveRecordFriend.CreateNew("*****@*****.**", testUserId); var secondFriend = new ActiveRecordFriend(friend.Id); secondFriend.EmailAddress = "updated"; secondFriend.Save(); var thirdFriend = new ActiveRecordFriend(friend.Id); Assert.AreEqual(friend.EmailAddress, thirdFriend.EmailAddress); }