NUnit hangs - testing ReadOnlyCollection<T>
This is my first attempt at Unit testing in general. Please bear with me.
public class Order
{
public string OrderId { get; set; }
public ContractStatus Status { get; set; }
public int OrderItemCount { get; set; }
public double Subtotal { get; set; }
private List<OrderItem> OrderItems { get; set; }
public Order()
{
}
public ReadOnlyCollect
{
get
{
}
}
public void AddOrderItem(
{
foreach (var item in this.OrderItems)
{
}
}
}
}
Test Below: NUnit will hang at "CreateOrder_
[TestFixture]
public class OrderServiceTest
{
private IContractRepository _contractReposi
private ContractService _contractService;
private IPartServiceRep
private const string ValidContractId = "CONTRACTID";
private const string ExpiredContractId = "EXPIREDCONTRAC
private const string ValidPartId = "PARTID";
private const double ValidPartPrice = 50.0;
[SetUp]
public void Initalize()
{
{
});
{
});
{
});
}
[Test]
public void CreateOrder_
{
// Arrange
var orderService = new OrderService();
var contractService = new ContractService
var contract = contractService
// Act
var newOrder = orderService.
// Assert
Guid guidOut;
}
[Test, ExpectedExcepti
public void CreateOrder_
{
// Arrange
var orderService = new OrderService();
var contractService = new ContractService
var contract = contractService
//Act
var order = orderService.
}
[Test]
public void CreateOrderItem
{
// Arrange
var orderService = new OrderService();
var contractService = new ContractService
var contract = contractService
var order = orderService.
var partService = new PartService(
var part = partService.
var quantity = 1;
// Act
var orderItem = orderService.
// Assert
}
}
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- NUnit V2 Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Simone Busoli
- Solved:
- Last query:
- Last reply: