コード例 #1
0
        public void GetDefault_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new KupahRepository(context);

            // Act
            kupah result = repository.GetDefault();

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue((bool)result.isDefault);
        }
コード例 #2
0
        public void GetAll_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new KupahRepository(context);

            // Act
            IEnumerable <kupah> result = repository.GetAll();

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(context.kupah.Count(), result.Count());
        }
コード例 #3
0
        public void GetDefault_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new KupahRepository(context);
            var service    = new KupahService(repository);

            // Act
            KupahModel result = service.GetDefault();

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.IsDefault);
        }
コード例 #4
0
        public void GetById_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new KupahRepository(context);
            int id         = 1;

            // Act
            kupah result = repository.GetById(id);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(id, result.id);
        }
コード例 #5
0
        public void GetById_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new KupahRepository(context);
            var service    = new KupahService(repository);
            int id         = 1;

            // Act
            KupahModel result = service.GetById(id);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(id, result.Id);
        }
コード例 #6
0
        public void GetAllFilterByCurrent_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new KupahRepository(context);
            var service    = new KupahService(repository);

            // Act
            IEnumerable <KupahModel> result = service.GetAllFilterByCurrent();

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(context.kupah.Where(x => x.isCurrent).Count(), result.Count());
            Assert.AreEqual(result.Where(x => x.IsCurrent).Count(), result.Count());
        }