public void DefaultValues() { var sut = new ProposalSelection(); Assert.AreEqual(new Proposal(), sut.Proposal); Assert.AreEqual(ProposalSelection.DefaultIndex, sut.Index); Assert.False(sut.SelectedAfter.HasValue); Assert.AreNotEqual(0, sut.GetHashCode()); Assert.AreNotEqual(1, sut.GetHashCode()); }
public void Equality_Default() { var a = new ProposalSelection(); var b = new ProposalSelection(); Assert.AreEqual(a, b); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentIndices() { var a = new ProposalSelection { Index = 1 }; var b = new ProposalSelection(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentSelectedAfterZero() { var a = new ProposalSelection { SelectedAfter = TimeSpan.FromMinutes(0) }; var b = new ProposalSelection(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentProposal() { var a = new ProposalSelection { Proposal = new Proposal { Relevance = 1 } }; var b = new ProposalSelection(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_SettingValues() { var a = new ProposalSelection { Proposal = new Proposal { Relevance = 1 }, SelectedAfter = TimeSpan.FromMinutes(2), Index = 3 }; var b = new ProposalSelection { Proposal = new Proposal { Relevance = 1 }, SelectedAfter = TimeSpan.FromMinutes(2), Index = 3 }; Assert.AreEqual(a, b); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); }