We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Cells unit testing with Xunit and MOQ

Can you please share sample unit test cases for Aspose Cells using Xunit and MOQ in c# (.Net Core)

@PramodHegde,
We have logged the issue as “CELLSNET-48846” in our database for investigations. Once we will have some news for you, we will update you in this topic.

@PramodHegde,

We do not know what you actually want to get, please elaborate and provide details on what kind of unit tests you need for Xunit and MOQ. I guess using the APIs, you should write your own unit test for your needs.

By the way, do you need examples against different APIs and feature, you may get these here: https://github.com/aspose-cells/Aspose.Cells-for-.NET

Hey - I am looking for some sample unit test cases which is written based on Aspose cells. You can provide any samples which you may have.

@PramodHegde,

Please note, we have many test cases, but we are afraid we cannot share those cases to users. The reason is some of these contain customers’ confidential and sensitive data and others follow our own design. Moreover, we cannot share test cases due to copyrights, also our internal policy does not allow us to share such code segments of unit test cases to public.

As requested earlier, please consume some time and test different features and APIs provided by Aspose.Cells and then write your test cases. If you got issues when testing our APIs with your tools, you may provide test cases or code segments to reproduce the issue on our end and we will investigate further.

See the following code segment on how to write simplest unit test case as an example:
e.g.
Sample code:

Workbook wb = new Workbook();
Cell cell = wb.Worksheets[0].Cells[0, 0];
cell.PutValue(123);
wb.Save("res.xlsx");
Workbook wbn = new Workbook("res.xlsx");
Cell celln = wbn.Worksheets[0].Cells[0, 0];
if(celln.IntValue != 123)
{
//Assert fail here, such as throw exception
throw new Exception("Set value has not been save or read correctly");
}

For common test case use some kind of framework, such as NUNIT, then the verifying code should be like:
Assert.AreEqual(123, celln.IntValue, "Read value...");

Hope, this helps a bit.