public void StructIsPassedAsValueType() { const int expectedId = 1; const string expectedAssetClass = "Interest Rate Swap"; var trade = new Trade {Id = expectedId, AssetClass = expectedAssetClass}; PassStructAndUpdateValues(trade); Assert.AreEqual(expectedId, trade.Id); Assert.AreEqual(expectedAssetClass, trade.AssetClass); }
private void PassStructAndUpdateValues(Trade trade) { trade.Id = 2; trade.AssetClass = "Credit Default Swap"; }
public void StructIsCreatedWithDefaultValues() { var trade = new Trade(); Assert.AreEqual(0, trade.Id); Assert.AreEqual(null, trade.AssetClass); }