Test Abstract Factory Source
Unit tests for the Abstract Factory design pattern implementation.
This file uses Google Test to verify the correctness of the Abstract Factory implementation. The tests ensure that the factories produce the correct products and that products from different factories are compatible within their families.
Functions
-
TEST(AbstractFactoryTest, ConcreteFactory1)
Tests ConcreteFactory1.
Verifies that ConcreteFactory1 correctly creates ConcreteProductA1 and ConcreteProductB1.
-
TEST(AbstractFactoryTest, ConcreteFactory2)
Tests ConcreteFactory2.
Verifies that ConcreteFactory2 correctly creates ConcreteProductA2 and ConcreteProductB2.
-
TEST(AbstractFactoryTest, Compatibility)
Tests compatibility between products from different factories.
Ensures that products created by ConcreteFactory1 and ConcreteFactory2 are compatible within their respective families.