Skip to content

test: added warehouseProduct and warehouse tests #1129

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KaranChadha10
Copy link

@KaranChadha10 KaranChadha10 commented Apr 12, 2025

Description

This PR contains the following points:

@KaranChadha10 KaranChadha10 mentioned this pull request Apr 12, 2025
Copy link
Member

@hishamco hishamco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please convert this PR to draft; once it's complete, you can change it

_stockRepositoryMock.Object,
_stockServiceMock.Object
);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

var result = await controller.GetProducts(warehouseId, smartTableParam);

// Assert
// Assert.IsType<ActionResult>(result);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the assertion is disabled?


var warehouseId = 1;
var productIds = new List<long> { 1, 2, 3 };

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

_stockRepositoryMock.Object,
_stockServiceMock.Object
);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines +97 to +98

// Add more test cases as needed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Add more test cases as needed

var warehouseRepositoryMock = new Mock<IRepository<Warehouse>>();
var addressRepositoryMock = new Mock<IRepository<Address>>();
var workContextMock = new Mock<IWorkContext>();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


var controller = new WarehouseApiController(warehouseRepositoryMock.Object, workContextMock.Object, addressRepositoryMock.Object);

// Act
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please complete the test

var controller = new WarehouseApiController(warehouseRepositoryMock.Object, workContextMock.Object, addressRepositoryMock.Object);
var param = new SmartTableParam();

// Act
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

var controller = new WarehouseApiController(warehouseRepositoryMock.Object, workContextMock.Object, addressRepositoryMock.Object);
var warehouseId = 1;

// Act
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here ..

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants