public void SetValue_AfterFinalize() { Relevance rel = new Relevance(); rel.SetValue(5); rel.Finalize(12); Assert.Throws <InvalidOperationException>(() => { rel.SetValue(8); }); }
public void SetValue_AfterFinalize() { Relevance rel = new Relevance(); rel.SetValue(5); rel.Finalize(12); rel.SetValue(8); }
public void SetValue() { Relevance rel = new Relevance(); rel.SetValue(8); Assert.AreEqual(8, rel.Value, "Wrong value"); Assert.IsFalse(rel.IsFinalized, "Value should not be finalized"); rel.SetValue(14); Assert.AreEqual(14, rel.Value, "Wrong value"); Assert.IsFalse(rel.IsFinalized, "Value should not be finalized"); }
public void Finalize_AlreadyFinalized() { Relevance rel = new Relevance(); rel.SetValue(8); rel.Finalize(0.5F); rel.Finalize(1); }
public void SetValue_Value_Invalid() { Relevance sut = new Relevance(); var ex = Assert.Throws <ArgumentOutOfRangeException>(() => sut.SetValue(-1)); Assert.Equal("Value must be greater than or equal to zero.\r\nParameter name: value", ex.Message); }
public void Finalize_InvalidFactor() { Relevance rel = new Relevance(); rel.SetValue(8); Assert.Throws <ArgumentOutOfRangeException>(() => { rel.Finalize(-1); }); }
public void Finalize_InvalidFactor() { Relevance rel = new Relevance(); rel.SetValue(8); rel.Finalize(-1); }
public void Finalize_AlreadyFinalized() { Relevance rel = new Relevance(); rel.SetValue(8); rel.Finalize(0.5F); Assert.Throws <InvalidOperationException>(() => { rel.Finalize(1); }); }
public void Finalize_Factor_Invalid() { Relevance sut = new Relevance(); sut.SetValue(0); var ex = Assert.Throws <ArgumentOutOfRangeException>(() => sut.Finalize(-1)); Assert.Equal("Total must be greater than or equal to zero.\r\nParameter name: total", ex.Message); }
public void Finalize_() { Relevance rel = new Relevance(); rel.SetValue(12); Assert.AreEqual(12, rel.Value, "Wrong value"); rel.Finalize(24); Assert.AreEqual(50, rel.Value, "Wrong finalized value"); Assert.IsTrue(rel.IsFinalized, "Value should be finalized"); }
// Underscore to avoid interference with Destructor public void Finalize_() { Relevance rel = new Relevance(); rel.SetValue(12); Assert.AreEqual(12, rel.Value, "Wrong value"); rel.Finalize(24); Assert.AreEqual(50, rel.Value, "Wrong finalized value"); Assert.IsTrue(rel.IsFinalized, "Value should be finalized"); }
public void Finalize_Already_Performed() { Relevance sut = new Relevance(); sut.SetValue(0); sut.Finalize(0.5F); var ex = Assert.Throws <InvalidOperationException>(() => sut.Finalize(1)); Assert.Equal("Finalization already performed.", ex.Message); }
// Underscore to avoid interference with Destructor public void Finalize_() { Relevance rel = new Relevance(); rel.SetValue(12); Assert.Equal(12, rel.Value); rel.Finalize(24); Assert.Equal(50, rel.Value); Assert.True(rel.IsFinalized, "Value should be finalized"); }
public void SetValue_InvalidValue() { Relevance rel = new Relevance(); rel.SetValue(-1); }
public void SetValue_InvalidValue() { Relevance rel = new Relevance(); Assert.Throws <ArgumentOutOfRangeException>(() => { rel.SetValue(-1); }); }