Exemplo n.º 1
0
        public void TestForGetUnreadNotificationCount()
        {
            DBNotificationManager service = new DBNotificationManager();
            var expectedCount             = service.GetUnreadNotificationCount("hverma").GetAwaiter().GetResult();

            Assert.AreEqual(expectedCount, 0);
        }
Exemplo n.º 2
0
        public async Task TestforsaveToDataBaseMethod()
        {
            Notification notify = new Notification()
            {
                Message = "Himani Liked your profile picture"
            };
            Mock <IAppUser> mock = new Mock <IAppUser>();

            mock.Setup(x => x.UpdateNotificationCount());

            DBNotificationManager mongo = new DBNotificationManager();
            var expectedOutput          = await mongo.SaveNotificationToDB(notify);

            Assert.AreEqual(notify.Message, expectedOutput.Message);
        }
Exemplo n.º 3
0
        public void TestForGetNotificationsForDatabase()
        {
            Mock <IAppUser> mock = new Mock <IAppUser>();

            mock.Setup(x => x.ResetNotificationCount("hverma"));
            List <Notification> listofnotifications = new List <Notification>();
            Notification        notify = new Notification()
            {
                Message = "Himani posted on your wall"
            };

            listofnotifications.Add(notify);
            DBNotificationManager mongo = new DBNotificationManager();
            var expectedOutput          = mongo.GetNotificationFromDB("hverma").GetAwaiter().GetResult();

            Assert.AreNotEqual(expectedOutput[0].Message, listofnotifications[0].Message);
        }