コード例 #1
0
ファイル: EmailsTest.cs プロジェクト: pcbender/AxosoftAPI.NET
        public void Setup()
        {
            client = new Mock <IProxy>();

            request          = new Mock <BaseRequest>(new Mock <IProxy>().Object);
            request.CallBase = true;

            // Create proxy instance (test constructors)
            emailsProxy = new AxosoftAPI.NET.Emails(client.Object);
            emailsProxy = new AxosoftAPI.NET.Emails(request.Object);
        }
コード例 #2
0
        public EmailsTest()
        {
            // Create instances to mocked all dependencies
            var LMockDbContext = new Mock <MainDbContext>();

            // Upload pre-fixed dummy data
            var LCountriesDbSet = DummyLoad.ReturnDummyCountries().AsQueryable().BuildMockDbSet();
            var LCitiesDbSet    = DummyLoad.ReturnDummyCities().AsQueryable().BuildMockDbSet();
            var LUsersDbSet     = DummyLoad.ReturnDummyUsers().AsQueryable().BuildMockDbSet();
            var LSigninHistory  = DummyLoad.ReturnSigninHistory().AsQueryable().BuildMockDbSet();

            // Populate database tables with dummy data
            LMockDbContext.Setup(AMainDbContext => AMainDbContext.Countries).Returns(LCountriesDbSet.Object);
            LMockDbContext.Setup(AMainDbContext => AMainDbContext.Cities).Returns(LCitiesDbSet.Object);
            LMockDbContext.Setup(AMainDbContext => AMainDbContext.Users).Returns(LUsersDbSet.Object);
            LMockDbContext.Setup(AMainDbContext => AMainDbContext.SigninHistory).Returns(LSigninHistory.Object);

            // Create test instance with mocked dependencies
            FEmails = new Emails(LMockDbContext.Object);
        }