42 lines
948 B
C#
42 lines
948 B
C#
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);
|
|
}
|
|
}
|