Exemplo n.º 1
0
        public void AddNewSeriesStatus_NewStatusToBeAdded_ReturnTrue()
        {
            // Arrange
            var service        = new BookSeriesStatusService();
            var totalBeforeAdd = service.Count();
            var model          = new BookSeriesStatu();

            // Act
            model.Description = "Test";;
            var  result          = service.AddNewBookSerieStatusValidation(model);
            var  totalAfterAdded = service.Count();
            bool validation;

            // Assert
            if (result == true)
            {
                if (totalBeforeAdd < totalAfterAdded)
                {
                    validation = true;
                }
                else
                {
                    validation = false;
                }
            }
            else
            {
                validation = false;
            }

            Assert.IsTrue(validation);
        }
Exemplo n.º 2
0
        public void AddeNewSeriesStatus_StatusAlreadyExist_ReturnFalse()
        {
            // Arrange
            var service = new BookSeriesStatusService();
            var model   = new BookSeriesStatu();

            // Act
            model.Description = "In Progress";
            var result = service.AddNewBookSerieStatusValidation(model);

            // Assert
            Assert.IsFalse(result);
        }
Exemplo n.º 3
0
        public void AddNewSeriesStatus_StatusIsEmpty_ReturnFalse()
        {
            // Arrange
            var service = new BookSeriesStatusService();
            var model   = new BookSeriesStatu();

            // Act
            model.Description = "";
            var result = service.AddNewBookSerieStatusValidation(model);

            // Assert
            Assert.IsFalse(result);
        }