public void MemberJoinedActivityAdd() { const string guidStr = "515b7240-3be1-43d4-8846-c0b589cd1cd2"; var activityRepository = Substitute.For<IActivityRepository>(); IActivityService activityService = new ActivityService(activityRepository, _badgeRepository, _membershipRepository, _loggingService); var user = new MembershipUser { Id = new Guid(guidStr), UserName = "******" }; activityService.MemberJoined(user); activityRepository.Received().Add((Arg.Is<Activity>(x => x.Data == MemberJoinedActivity.KeyUserId + "=" + guidStr))); }