예제 #1
0
 public void TestInitialize()
 {
     _iLogger     = new FileLogger();
     _iClient     = new WebClient();
     _iPostDAL    = new PostDAL(_iLogger, _iClient);
     _stubIClient = new StubIClient();
 }
예제 #2
0
 public User(IUserDAL user, IPostDAL post, ICommentDAL comment, ILikeDAL like, IUserDALNeo4j userDALNeo4J, IStreamDALCassandra stream, IStreamDataCassandra streamData)
 {
     _user       = user;
     _post       = post;
     _comment    = comment;
     _like       = like;
     _userNeo4j  = userDALNeo4J;
     _streamData = streamData;
     _stream     = stream;
 }
예제 #3
0
 public void TestTearDown()
 {
     if (_iPostDAL != null)
     {
         _iPostDAL = null;
     }
     if (_iClient != null)
     {
         _iClient = null;
     }
 }
예제 #4
0
        public void QueryAllPostsOnGetStringException()
        {
            _iPostDAL = new PostDAL(_iLogger, _stubIClient);

            _stubIClient.GetResponseHttpClientString = (arg1, arg2) =>
            {
                throw new Exception();
            };
            _iPostDAL.QueryDetail <Post>(Helper.GetURL(new RequestObject()
            {
                URL = ""
            }));
        }
예제 #5
0
        public void QueryAllPostsOnGetStringIsNull()
        {
            try
            {
                _iPostDAL = new PostDAL(_iLogger, _stubIClient);

                _stubIClient.GetResponseHttpClientString = (arg1, arg2) =>
                {
                    return("...");
                };
                _iPostDAL.QueryDetail <Post>(Helper.GetURL(new RequestObject()
                {
                    URL = ""
                }));
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.Message == "Input string '...' is not a valid number. Path '', line 1, position 3.");
            }
        }
예제 #6
0
 public PostBLL()
     : base(_Type)
 {
     this._Dal = base.CurrentDAL as IPostDAL;
 }
예제 #7
0
 public PostBLL(IPostDAL post, IMapper mapper)
 {
     _post   = post;
     _mapper = mapper;
 }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MainViewModel"/> class.
 /// </summary>
 /// <param name="iPostDAL">The i post dal.</param>
 /// <param name="iLogger">The i logger.</param>
 public MainViewModel(IPostDAL iPostDAL, ILogger iLogger)
 {
     _postDAL = iPostDAL;
     _iLogger = iLogger;
 }