コード例 #1
0
        public void Epic_Service_GetAll_Method_should_return_productbacklog_type_object()
        {
            //Arrange
            List <EpicMaster> requests = new List <EpicMaster>();
            var request = new EpicMaster();

            request.EpicId = 1;
            requests.Add(request);
            var mockRepoReq = new Mock <IEpicRepository>();        //mocking RequestRepository

            mockRepoReq.Setup(x => x.GetAll(1)).Returns(requests); //mocking GetAll() of RequestRepository
            EpicService obj = new EpicService(mockRepoReq.Object);
            //Act
            var res = obj.GetAll(1);

            //Assert
            Assert.IsType <List <EpicMaster> >(res);
        }
コード例 #2
0
        public void Epic_Service_GetAll_Method_To_GetAll_Epics()
        {
            //Arrange
            List <EpicMaster> requests = new List <EpicMaster>();
            var request = new EpicMaster();

            request.EpicId = 1;
            requests.Add(request);
            var mockRepoReq = new Mock <IEpicRepository>();        //mocking RequestRepository

            mockRepoReq.Setup(x => x.GetAll(1)).Returns(requests); //mocking GetAll() of RequestRepository
            EpicService obj = new EpicService(mockRepoReq.Object);
            //Act
            var res = obj.GetAll(1);

            //Assert
            Assert.NotNull(res);
            Assert.Equal(requests, res);
        }