public void Clone_ReturnsSameContent() { var r = new Role("dev", "developer", "def"); var c = new Contribution("name", r); c.Date = DateTime.Now; c.Comments = "stupid note"; Assert.IsTrue(c.AreContentsEqual(c.Clone() as Contribution)); }
public void AreContentsEqual_LicensesDifferent_ReturnsFalse() { var l1 = License.CreativeCommons_Attribution; var l2 = License.CreativeCommons_Attribution_ShareAlike; var c1 = new Contribution("joey", null) { ApprovedLicense = l1 }; var c2 = new Contribution("joey", null) { ApprovedLicense = l2 }; Assert.IsFalse(c1.AreContentsEqual(c2)); }
public void AreContentsEqual_RolesDifferent_ReturnsFalse() { var r1 = new Role("codered", null, null); var r2 = new Role("codeblue", null, null); var c1 = new Contribution("joey", r1); var c2 = new Contribution("joey", r2); Assert.IsFalse(c1.AreContentsEqual(c2)); }
public void AreContentsEqual_NotesDifferent_ReturnsFalse() { var c1 = new Contribution("bucky", null) { Comments = "get bread" }; var c2 = new Contribution("bucky", null) { Comments = "get pickles" }; Assert.IsFalse(c1.AreContentsEqual(c2)); }
public void AreContentsEqual_DatesDifferent_ReturnsFalse() { var c1 = new Contribution("bucky", null) { Date = DateTime.Now }; var c2 = new Contribution("bucky", null) { Date = DateTime.Now.AddDays(1) }; Assert.IsFalse(c1.AreContentsEqual(c2)); }
public void AreContentsEqual_NamesDifferent_ReturnsFalse() { var c1 = new Contribution("joey", null); var c2 = new Contribution("bucky", null); Assert.IsFalse(c1.AreContentsEqual(c2)); }
public void AreContentsEqual_OtherIsNull_ReturnsFalse() { var c = new Contribution(null, null); Assert.IsFalse(c.AreContentsEqual(null)); }
public void AreContentsEqual_AllSame_ReturnsTrue() { var r1 = new Role("dev", "developer", "def"); var r2 = new Role("dev", "developer", "def"); var l1 = License.CreativeCommons_Attribution; var l2 = License.CreativeCommons_Attribution; var d1 = DateTime.Now; var c1 = new Contribution("joey", r1) { Date = d1, Comments = "get bread", ApprovedLicense = l1 }; var c2 = new Contribution("joey", r2) { Date = d1, Comments = "get bread", ApprovedLicense = l2 }; Assert.IsTrue(c1.AreContentsEqual(c2)); }