Ejemplo n.º 1
0
        public void PostTextWithUser()
        {
            // Arrange.
            string               dbConnectionString   = ConfigurationManager.ConnectionStrings["DbConnectionString"].ConnectionString;
            int                  timeoutSeconds       = int.Parse(ConfigurationManager.AppSettings["TimeoutSeconds"]);
            DbConnection         dbConnection         = new DbConnection(dbConnectionString, timeoutSeconds);
            SocialNetworkService socialNetworkService = new SocialNetworkService(dbConnection);

            // Act and assert.
            Assert.DoesNotThrow(() => { socialNetworkService.PostToTimeline("Bodrul", "Unit testing this functionality."); });
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Post text to a User's Timeline.
 /// </summary>
 /// <param name="userName"></param>
 /// <param name="text"></param>
 private static void PostToTimeline(string userName, string text) => _socialNetworkService.PostToTimeline(userName, text);