Exemplo n.º 1
0
        private IFactor GetStructuralFactor()
        {
            _referenceHeight      = new ReferenceHeight(_building, _terrain);
            _turbulentLengthScale = new TurbulentLengthScale(_terrain);

            var logarithmicDecrementOfDamping = GetLogarithmicDecrementOfDamping();

            _fundamentalFlexuralFrequency =
                new FundamentalFlexuralFrequencyForHeightAbove50(_building);

            var resonanceResponse = GetResonanceResponse(
                logarithmicDecrementOfDamping);

            var backgroundFactor =
                new BackgroundFactor(
                    _building,
                    _referenceHeight,
                    _turbulentLengthScale);

            var dynamicFactor = GetDynamicFactor(
                resonanceResponse, backgroundFactor);
            var sizeFactor =
                new SizeFactor(
                    _referenceHeight,
                    _windLoadData,
                    backgroundFactor);
            var structuralFactor =
                new StructuralFactor(sizeFactor, dynamicFactor);

            return(structuralFactor);
        }
Exemplo n.º 2
0
        public void GetFactorTest_Success()
        {
            var building = new Mock <IStructure>();

            building.Setup(b => b.Width).Returns(1);
            building.Setup(b => b.Height).Returns(3);
            var referenceHeight = new Mock <IFactor>();

            referenceHeight.Setup(rh => rh.GetFactor()).Returns(2);
            var turbulentLengthScale = new Mock <IFactorAt>();

            turbulentLengthScale.Setup(tls => tls.GetFactorAt(2)).Returns(5);

            var backgroundFactor = new BackgroundFactor(
                building.Object, referenceHeight.Object, turbulentLengthScale.Object);

            var result = backgroundFactor.GetFactor();

            Assert.That(result, Is.EqualTo(0.561).Within(0.001));
        }