27 lines
713 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "system_class.h"
// Mock pour direct_3d_class
class MockDirect3D : public d_3d_class {
public:
MOCK_METHOD(void, begin_scene, (float, float, float, float), (override));
MOCK_METHOD(void, end_scene, (), (override));
// Ajoutez d'autres méthodes mockées si besoin
};
TEST(system_class, integration_begin_end_scene)
{
system_class system;
auto* mockD3D = new MockDirect3D();
system.initialize();
system.run();
// Injectez le mock dans lapplication
system.get_application()->set_direct_3d(mockD3D);
EXPECT_CALL(*mockD3D, begin_scene(testing::_, testing::_, testing::_, testing::_)).Times(1);
EXPECT_CALL(*mockD3D, end_scene()).Times(1);
}