public void ClientMethod(IAbstractFactory factory)
    {
        IAbstractProductA productA = factory.CreateProductA();
        IAbstractProductB productB = factory.CreateProductB();

        Console.WriteLine(productB.UsefulFunctionB());
        Console.WriteLine(productB.AnotherUsefulFunctionB(productA));
    }
        public void AbstractFactoryTest()
        {
            // The client code can work with any concrete factory class.
            const int firstExpectedResult = 2;

            ClientMethod(new ConcreteFactory1());
            _productA.AddingFunction(1).Should().Be(firstExpectedResult);
            _productB.UsefulFunctionB().Should().Be(Text.ResultB1);
            _productB.AnotherUsefulFunctionB(_productA).Should()
            .Be(Text.WithTheResultFromTheFirstFunction(firstExpectedResult));

            const int secondExpectedResult = 3;

            ClientMethod(new ConcreteFactory2());
            _productA.AddingFunction(1).Should().Be(secondExpectedResult);
            _productB.UsefulFunctionB().Should().Be(Text.ResultB2);
            _productB.AnotherUsefulFunctionB(_productA).Should()
            .Be(Text.WithTheResultFromTheSecondFunction(secondExpectedResult));
        }