I have a game that has coins. There is an Add() method that changes the coins. I want to test if it adds correctly.
public class CoinsService 
{
    public ReactiveProperty<long> Coins { get { return State.SaveGame.Coins; } }
    public int Add(int coins)
    {
         Coins.Value += coins;
         return coins;
    }
}
The test:
public class CoinServiceTests
{
     [Test]
     public void AddCoins_WhenCalled_AddsUpToTotalCoins()
     {
          var coinsService = new CoinsService();
          coinsService.Add(10);
          Assert.That(coinsService.Coins.Value, Is.EqualTo(10));
     }
}
I have tried making a substitute of the class using NSubstitute like that:
var coinsService = Substitute.For<CoinsService>();
and instantiating a fresh instance of the Coins like that
coinsService.Coins.Returns(new ReactiveProperty<long>());
also like that
var coins = new ReactiveProperty<long>();
coinsService.Coins.Returns(coins);
I expect that that after doing any of the above, I will be able to check the Coins value. 
Instead I'm getting a null reference object exception that the coinsService.Coins object is null
To clarify, the null reference appears on the line
public ReactiveProperty<long> Coins { get { return State.SaveGame.Coins; } }
 
     
    