コード例 #1
0
        public void Given_none_existing_group_When_Calculate_Then_should_throw_correct_exception()
        {
            // Given
            var controlSystemCalculationService = new ControlSystemCalculationService(_repository.Object);

            //When
            //Then
            Assert.Throws<NoneMatchingControlSystemRuleException>(() => controlSystemCalculationService.Calculate("ZZZZZZZZZ", MatterState.Liquid, Quantity.Small, DustinessOrVolatility.High));
            
        }
コード例 #2
0
        public void Given_various_parameters_When_calculate_called_Then_returns_correct_control_system(
            string hazardGroupCode, 
            MatterState? matterState, 
            Quantity? quantity, 
            DustinessOrVolatility? dustinessOrVolatility,
            string expectedDescription)
        {
            //When
            var controlSystemCalculationService = new ControlSystemCalculationService(_repository.Object);
            var controlSystem = controlSystemCalculationService.Calculate(hazardGroupCode, matterState, quantity,
                                                                          dustinessOrVolatility);

            //Then
            Assert.AreEqual(expectedDescription, controlSystem.Description);
        }