/// <summary> /// Determines whether the specified System.Object are considered equal. /// </summary> /// <param name="obj">The System.Object to compare with the current System.Object</param> /// <returns>true if the specified System.Object is equal to the current System.Object; otherwise, false.</returns> public override bool Equals(object obj) { InboxMessage other = obj as InboxMessage; if (other == null) { return(false); } if (ReadAt != other.ReadAt) { return(false); } if (ReceivedAt != other.ReceivedAt) { return(false); } if (ReadBy != other.ReadBy) { return(false); } return(base.Equals(obj)); }
public void GetMessage_WithId_ReturnsSentMessage() { // Arrange var id = Guid.NewGuid(); RestResource resource = new MessageHeadersResource(id); var response = new RestResponse { StatusCode = HttpStatusCode.OK, Content = "serialisedItem" }; var expectedResult = new InboxMessage(); mockRestClient .Setup(rc => rc.Get(resource)) .Returns(response); mockSerialiser .Setup(s => s.Deserialise<InboxMessage>(response.Content)) .Returns(expectedResult); // Act var actualResult = service.GetMessage(id); // Assert Assert.AreEqual(expectedResult, actualResult); }