rama creada apartir de master en j
This commit is contained in:
@@ -11,49 +11,55 @@ internal class CameraServiceTest
|
||||
//Dictionary<string, object> cameraSettings;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// NUnit <see cref="SetUpAttribute"/> method executed before each test to initialize shared test state, such as camera configuration dictionaries, mocked camera and logger services, and a mocked subscribers service. Currently all initialization logic is commented out, so the method performs no setup actions.
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
//cameraSettings = new Dictionary<string, object>()
|
||||
//{
|
||||
// { "camHost", "http://localhost:8080" },
|
||||
// { "camUser", "username" },
|
||||
// { "camPassword", "password" }
|
||||
//};
|
||||
//cameraServiceMock = new Mock<CameraService>();
|
||||
|
||||
//logger = new Mock<ILogger<CameraService>>();
|
||||
|
||||
//cameraService = new CameraService(
|
||||
// logger.Object
|
||||
// );
|
||||
|
||||
|
||||
// Create a mock of the singleton class subscribers
|
||||
//var mockSingleton = new Mock<ISubscribersService>();
|
||||
|
||||
//var subscribers = new List<WsSubscriber>();
|
||||
|
||||
// Set up the mock object to return a specific value when a method is called
|
||||
//mockSingleton.Setup(x => x.GetSubscribers()).Returns(subscribers);
|
||||
}
|
||||
public void Setup()
|
||||
{
|
||||
//cameraSettings = new Dictionary<string, object>()
|
||||
//{
|
||||
// { "camHost", "http://localhost:8080" },
|
||||
// { "camUser", "username" },
|
||||
// { "camPassword", "password" }
|
||||
//};
|
||||
//cameraServiceMock = new Mock<CameraService>();
|
||||
|
||||
//logger = new Mock<ILogger<CameraService>>();
|
||||
|
||||
//cameraService = new CameraService(
|
||||
// logger.Object
|
||||
// );
|
||||
|
||||
|
||||
// Create a mock of the singleton class subscribers
|
||||
//var mockSingleton = new Mock<ISubscribersService>();
|
||||
|
||||
//var subscribers = new List<WsSubscriber>();
|
||||
|
||||
// Set up the mock object to return a specific value when a method is called
|
||||
//mockSingleton.Setup(x => x.GetSubscribers()).Returns(subscribers);
|
||||
}
|
||||
|
||||
//TODO HttpWebResponse test
|
||||
//[Test]
|
||||
/// <summary>
|
||||
/// Verifies that the <c>MaskStream</c> operation on the camera service returns a valid response when invoked with activation and coordinate parameters against the configured camera settings. Covers the scenario where the underlying grab response is null, ensuring the service still produces a non-null response with the expected status code and content.
|
||||
/// </summary>
|
||||
public void MaskStream_Return_Ok()
|
||||
{
|
||||
//bool activate = true;
|
||||
//string coordinates = "100,100";
|
||||
//var expectedResponse = new HttpResponseMessage();
|
||||
|
||||
////cameraServiceMock.Setup(c => c.GrabResponse(It.IsAny<string>(), It.IsAny<string>())).Returns(((string)null));
|
||||
|
||||
//// Act
|
||||
//var response = cameraService.MaskStream(activate, coordinates, cameraSettings);
|
||||
|
||||
//// Assert
|
||||
//Assert.IsNotNull(response);
|
||||
//Assert.AreEqual(expectedResponse.StatusCode, response.StatusCode);
|
||||
//Assert.AreEqual(expectedResponse.Content, response.Content);
|
||||
}
|
||||
{
|
||||
//bool activate = true;
|
||||
//string coordinates = "100,100";
|
||||
//var expectedResponse = new HttpResponseMessage();
|
||||
|
||||
////cameraServiceMock.Setup(c => c.GrabResponse(It.IsAny<string>(), It.IsAny<string>())).Returns(((string)null));
|
||||
|
||||
//// Act
|
||||
//var response = cameraService.MaskStream(activate, coordinates, cameraSettings);
|
||||
|
||||
//// Assert
|
||||
//Assert.IsNotNull(response);
|
||||
//Assert.AreEqual(expectedResponse.StatusCode, response.StatusCode);
|
||||
//Assert.AreEqual(expectedResponse.Content, response.Content);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user