Пример #1
0
        public void ReturnNotNull_TeamToolsDbContext()
        {
            // Arrange & Act
            var result = MeetMeDbContext.Create();

            // Assert
            Assert.IsNotNull(result);
        }
Пример #2
0
        public void ReturnInstanceOf_TeamToolsDbContext()
        {
            // Arrange & Act
            var result = MeetMeDbContext.Create();

            // Assert
            Assert.IsInstanceOf <MeetMeDbContext>(result);
        }
Пример #3
0
        public void InitializeTeamToolsDbContext_Correct()
        {
            // Arrange & Act
            var context = new MeetMeDbContext();

            // Assert
            Assert.IsNotNull(context);
        }
Пример #4
0
        public AuthRepository()
        {
            _context     = new MeetMeDbContext();
            _userManager = new ApplicationUserManager(new UserStore <User>(_context));
            var provider = new DpapiDataProtectionProvider("MeetMe");

            _userManager.UserTokenProvider = new DataProtectorTokenProvider <User>(provider.Create("EmailConfirmation"));
            _userManager.EmailService      = new EmailService();
        }
Пример #5
0
        public void InitializeTeamToolsDbContext_CorrectWhenStateFactoryIsSet()
        {
            // Arrange
            var mockedFactory = new Mock <IStateFactory>();

            // Act
            var context = new MeetMeDbContext(mockedFactory.Object);

            // Assert
            Assert.IsNotNull(context);
        }
Пример #6
0
        public void IsVirtual()
        {
            // Arrange
            var mockedDbSet = new Mock <IDbSet <Notification> >();
            var context     = new MeetMeDbContext();

            // Act
            bool isVirtual = context.GetType().GetProperty("Notifications").GetGetMethod().IsVirtual;

            // Assert
            Assert.IsTrue(isVirtual);
        }
Пример #7
0
        public void SetNotifications_Correct()
        {
            // Arrange
            var mockedDbSet = new Mock <IDbSet <Notification> >();
            var context     = new MeetMeDbContext();

            // Act
            context.Notifications = mockedDbSet.Object;

            // Assert
            Assert.AreSame(context.Notifications, mockedDbSet.Object);
        }
Пример #8
0
        public void SetCustomUsers_Correct()
        {
            // Arrange
            var mockedDbSet = new Mock <IDbSet <CustomUser> >();
            var context     = new MeetMeDbContext();

            // Act
            context.CustomUsers = mockedDbSet.Object;

            // Assert
            Assert.AreSame(context.CustomUsers, mockedDbSet.Object);
        }
Пример #9
0
        public void IsVirtual()
        {
            // Arrange
            var mockedDbSet = new Mock <IDbSet <CustomUser> >();
            var context     = new MeetMeDbContext();

            // Act
            bool isVirtual = context.GetType().GetProperty("Comments").GetGetMethod().IsVirtual;

            // Assert
            Assert.IsTrue(isVirtual);
        }
Пример #10
0
        public void SetMessages_Correct()
        {
            // Arrange
            var mockedDbSet = new Mock <IDbSet <Message> >();
            var context     = new MeetMeDbContext();

            // Act
            context.Messages = mockedDbSet.Object;

            // Assert
            Assert.AreSame(context.Messages, mockedDbSet.Object);
        }
Пример #11
0
        public void SetStatistics_Correct()
        {
            // Arrange
            var mockedDbSet = new Mock <IDbSet <Statistic> >();
            var context     = new MeetMeDbContext();

            // Act
            context.Statistics = mockedDbSet.Object;

            // Assert
            Assert.AreSame(context.Statistics, mockedDbSet.Object);
        }
 public EventRepository()
 {
     _context = new MeetMeDbContext();
 }
Пример #13
0
 public ConnectionNotificationRepository()
 {
     _context = new MeetMeDbContext();
 }
Пример #14
0
 public MeetingRepository()
 {
     _context = new MeetMeDbContext();
 }
Пример #15
0
 public UserRepository()
 {
     _context = new MeetMeDbContext();
 }
Пример #16
0
 public static void Initialize()
 {
     Database.SetInitializer(new MigrateDatabaseToLatestVersion <MeetMeDbContext, Configuration>());
     MeetMeDbContext.Create().Database.Initialize(true);
 }