Beispiel #1
0
        public void Update_ManagementProperties()
        {
            // Arrange
            IManagementPropertiesDataMapper dataMapper = new ManagementPropertiesJsonDataMapper(_managementPropertiesPath);
            ManagementProperties            properties = new ManagementProperties
            {
                OlcPrice = 150,
                PeriodAfterLastCourseEmployableInDays = 2,
                PeriodBeforeStartNotifiable           = 4,
                PeriodEducationPlanInDays             = 100,
                Footer = "new footer"
            };

            // Act
            dataMapper.Update(properties);

            // Assert
            var propertiesResult = dataMapper.FindManagementProperties();

            Assert.AreEqual(150, propertiesResult.OlcPrice);
            Assert.AreEqual(2, propertiesResult.PeriodAfterLastCourseEmployableInDays);
            Assert.AreEqual(4, propertiesResult.PeriodBeforeStartNotifiable);
            Assert.AreEqual(100, propertiesResult.PeriodEducationPlanInDays);
            Assert.AreEqual("new footer", propertiesResult.Footer);
        }
Beispiel #2
0
        public void Update_WithNotExistingPath_ManagementProperties_ExceptionThrowed()
        {
            // Arrange
            IManagementPropertiesDataMapper dataMapper = new ManagementPropertiesJsonDataMapper("noPath");
            ManagementProperties            properties = new ManagementProperties
            {
                OlcPrice = 150,
                PeriodAfterLastCourseEmployableInDays = 2,
                PeriodBeforeStartNotifiable           = 4,
                PeriodEducationPlanInDays             = 100,
                Footer        = "new footer",
                StaffDiscount = 80,
            };

            // Act
            dataMapper.Update(properties);

            // Assert FileNotFoundException
        }