コード例 #1
0
        public void AddFacility_ValidModel_ReturnId(int siteId, int facilityId)
        {
            var newItem = new Facility
            {
                Id     = facilityId,
                SiteId = siteId
            };

            //act
            var service  = new SiteService(_siteRepository.Object, _facilityRepository.Object, _logger.Object);
            var returnId = service.AddFacility(siteId, newItem);

            //assert
            Assert.Equal(facilityId, returnId);
            Assert.NotEqual(0, newItem.Id);
            Assert.NotEqual(DateTime.MinValue, newItem.Created);
            Assert.True(_facilityData.Count == 2);
        }