Add backend projects with core models and tests, setup Godot frontend
This commit is contained in:
41
backend/tests/MyBiz.Tests/ProductTests.cs
Normal file
41
backend/tests/MyBiz.Tests/ProductTests.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using MyBiz.Core;
|
||||
|
||||
namespace MyBiz.Tests;
|
||||
|
||||
public class ProductTests
|
||||
{
|
||||
[Fact]
|
||||
public void Product_Creation_ShouldInitializeProperties()
|
||||
{
|
||||
// Arrange & Act
|
||||
var product = new Product
|
||||
{
|
||||
Type = ProductType.Food,
|
||||
Name = "Bread",
|
||||
Category = ProductCategory.ConsumerGoods,
|
||||
BasePrice = 10m
|
||||
};
|
||||
|
||||
// Assert
|
||||
Assert.Equal(ProductType.Food, product.Type);
|
||||
Assert.Equal("Bread", product.Name);
|
||||
Assert.Equal(ProductCategory.ConsumerGoods, product.Category);
|
||||
Assert.Equal(10m, product.BasePrice);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Product_CurrentPrice_ShouldDefaultToBasePrice()
|
||||
{
|
||||
// Arrange
|
||||
var product = new Product
|
||||
{
|
||||
BasePrice = 25m
|
||||
};
|
||||
|
||||
// Act
|
||||
product.CurrentPrice = product.BasePrice;
|
||||
|
||||
// Assert
|
||||
Assert.Equal(25m, product.CurrentPrice);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user