public void ShouldGetDashboard()
        {
            var engagementId = 1;
            var chartSet     = "dashboard";

            _dashboardController.Get(chartSet, engagementId);
            _mockDashboardService.Verify(ds => ds.Get(chartSet, engagementId), Times.Once);
        }
Beispiel #2
0
        public void DashboardTest()
        {
            try
            {
                DashboardController ab = new DashboardController();

                JObject ob = new JObject();
                ob["sup_id"]     = 117;
                ob["c_name"]     = "TestService";
                ob["c_message"]  = "Testing My Service";
                ob["c_pricetag"] = "99";
                ob["price_type"] = "T";



                Assert.AreEqual(1, ab.Post(ob));
                Assert.AreEqual(117, ab.Get(117).sup_id);
            }
            catch (UnitTestAssertException e)
            {
                Assert.Fail("Service Cant be Added Or Fetched Supplier is Wrong: " + " " + e.Message);
            }
            catch (NullReferenceException e)
            {
                Assert.Fail("Value doesnt Exsits");
            }

            catch (Exception e)
            {
                Assert.Fail(e.Message);
            }
        }
Beispiel #3
0
        public void GetDashboard()
        {
            TestHelper.InitDatabase();
            GetReady();
            var actRes   = controller.Get();
            var response = actRes.ExecuteAsync(CancellationToken.None).Result;

            Assert.IsNotNull(response.Content);
        }
Beispiel #4
0
        public void GetDashboardInfo()
        {
            TestHelper.InitDatabase();
            GetReady();
            var actRes   = controller.Get();
            var response = actRes.ExecuteAsync(CancellationToken.None).Result;

            Assert.IsTrue(response.IsSuccessStatusCode);
        }
Beispiel #5
0
        public void GetById_NotNull()
        {
            var myController = new DashboardController(_fakeDashboardService);
            var dashboard    = new Dashboard();
            var id           = "1";

            A.CallTo(() => _fakeDashboardService.GetById(id)).Returns(dashboard);
            var result = myController.Get(id);

            A.CallTo(() => _fakeDashboardService.GetById(id)).MustHaveHappened();
            Assert.AreEqual(1, 1);
        }
Beispiel #6
0
        public async Task GetDashboardAsync_ShouldReturnDashboard_WhenDashboardExists()
        {
            int         id        = 2;
            DashboardVM dashboard = new DashboardVM()
            {
                TotalEvents       = 8,
                LivesImpacted     = 877,
                TotalVolunteers   = 56,
                TotalParticipants = 6
            };

            _dashboardRepository.Setup(x => x.Get()).ReturnsAsync(dashboard);

            var result = await dashboardController.Get();

            Assert.AreEqual(result.Value.TotalEvents, 8);
            Assert.AreEqual(result.Value.LivesImpacted, 877);
            Assert.AreEqual(result.Value.TotalVolunteers, 56);
            Assert.AreEqual(result.Value.TotalParticipants, 6);
        }