Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 private void PassStructAndUpdateValues(Trade trade)
 {
     trade.Id = 2;
     trade.AssetClass = "Credit Default Swap";
 }
Esempio n. 3
0
 public void StructIsCreatedWithDefaultValues()
 {
     var trade = new Trade();
     Assert.AreEqual(0, trade.Id);
     Assert.AreEqual(null, trade.AssetClass);
 }