public void Get_ShouldReturnNull_WhenTheSpecifiedFacetDoesNotExist()
        {
            const int facetId = 3;

            var facetRepository = Substitute.For<IRepository<Facet>>();
            facetRepository.GetById(facetId).Returns((Facet)null);

            var facetsService = new FacetsService(facetRepository);

            var returnedFacet = facetsService.Get(facetId);

            Assert.IsNull(returnedFacet);
        }
Example #2
0
        public void Get_ShouldReturnNull_WhenTheSpecifiedFacetDoesNotExist()
        {
            const int facetId = 3;

            var facetRepository = Substitute.For <IRepository <Facet> >();

            facetRepository.GetById(facetId).Returns((Facet)null);

            var facetsService = new FacetsService(facetRepository);

            var returnedFacet = facetsService.Get(facetId);

            Assert.IsNull(returnedFacet);
        }
Example #3
0
        public void Get_ShouldReturnTheSpecifiedFacet_WhenTheFacetExists()
        {
            const int facetId = 2;

            var facetRepository = Substitute.For <IRepository <Facet> >();

            facetRepository.GetById(facetId).Returns(bigFeet);

            var facetsService = new FacetsService(facetRepository);

            var returnedFacet = facetsService.Get(facetId);

            Assert.AreEqual(bigFeet, returnedFacet);
        }
        public void Get_ShouldReturnTheSpecifiedFacet_WhenTheFacetExists()
        {
            const int facetId = 2;

            var facetRepository = Substitute.For<IRepository<Facet>>();
            facetRepository.GetById(facetId).Returns(bigFeet);

            var facetsService = new FacetsService(facetRepository);

            var returnedFacet = facetsService.Get(facetId);

            Assert.AreEqual(bigFeet, returnedFacet);
        }