public void DifferentCents_ReturnsFalse() { Usd x = new Usd(1); Usd y = new Usd(2); Assert.False(x == y); }
public void SameCents_ReturnsTrue() { Usd x = new Usd(1); Usd y = new Usd(1); Assert.True(x == y); }
public void DifferentCents_ReturnsTrue() { Usd x = new Usd(1); Usd y = new Usd(2); Assert.True(x != y); }
public void NullY_ReturnsFalse() { Usd x = new Usd(1); Usd y = null !; Assert.False(x == y); }
public void NullXAndNullY_ReturnsFalse() { Usd x = null !; Usd y = null !; Assert.False(x != y); }
public void NullY_ReturnsTrue() { Usd x = new Usd(1); Usd y = null !; Assert.True(x != y); }
public void NullXAndNullY_ReturnsTrue() { Usd x = null !; Usd y = null !; Assert.True(x == y); }
public void SameCents_ReturnsFalse() { Usd x = new Usd(1); Usd y = new Usd(1); Assert.False(x != y); }
public void SameReference_ReturnsFalse() { Usd usd = new Usd(1); Usd x = usd; Usd y = usd; Assert.False(x != y); }
public void SameReference_ReturnsTrue() { Usd usd = new Usd(1); Usd x = usd; Usd y = usd; Assert.True(x == y); }
public void WhenCentsEquals100_Returns1() { var price = new Usd(100); Assert.Equal("$1", price.DisplayPrice); }
public void NotUsdObj_ReturnsFalse() { var usd = new Usd(0); Assert.False(usd.Equals("string")); }
public void CentsEqualsOne_SetsCents() { var usd = new Usd(1); Assert.Equal(1, usd.Cents); }
public void SameReferenceObj_ReturnsTrue() { var usd = new Usd(0); Assert.True(usd.Equals(usd)); }
public void UsdObjWithDifferentCents_ReturnsFalse() { var usd = new Usd(0); Assert.False(usd.Equals(new Usd(1))); }
public void UsdObjWithSameCents_ReturnsTrue() { var usd = new Usd(0); Assert.True(usd.Equals(new Usd(0))); }
public void NullObj_ReturnsFalse() { var usd = new Usd(0); Assert.False(usd.Equals(obj: null !)); }
public void OneHundredCents_ReturnsFormatted() { var usd = new Usd(100); Assert.Equal("$1.00", usd.ToString()); }
public void CentsEqualsZero_SetsCents() { var usd = new Usd(0); Assert.Equal(0, usd.Cents); }
public void OneCent_ReturnsFormatted() { var usd = new Usd(1); Assert.Equal("$0.01", usd.ToString()); }
public void TenThousandCents_ReturnsFormatted() { var usd = new Usd(10000); Assert.Equal("$100.00", usd.ToString()); }
public void WhenCalled_ReturnsCentsGetHashCode() { var usd = new Usd(1); Assert.Equal(HashCode.Combine(usd.Cents), usd.GetHashCode()); }
public void TenCents_ReturnsFormatted() { var usd = new Usd(10); Assert.Equal("$0.10", usd.ToString()); }
public void WhenCentsEquals199_Returns199() { var price = new Usd(199); Assert.Equal("$1.99", price.DisplayPrice); }