public void ParseItemFromDatabaseTest() { MockChatRoomDatabaseReader mockDatabaseReader = new MockChatRoomDatabaseReader(); mockDatabaseReader.AddRow("chat901258305184729544", _ParticipantsData); ChatRoomInformationReader_Accessor target = new ChatRoomInformationReader_Accessor(); target.ParseDatabase(mockDatabaseReader); ChatRoomInformation expected = new ChatRoomInformation("chat901258305184729544", new string[] { "+15402392304", "+12068189288" }); ChatRoomInformation actual = target.ParseItemFromDatabase(mockDatabaseReader); Assert.AreEqual(expected, actual); }
public bool Equals(ChatRoomInformation other) { if (this.ChatId != other.ChatId) { return(false); } if (!Enumerable.SequenceEqual(this.Participants, other.Participants)) { return(false); } return(true); }
public bool Equals(ChatRoomInformation other) { if (this.ChatId != other.ChatId) { return false; } if (!Enumerable.SequenceEqual(this.Participants, other.Participants)) { return false; } return true; }
private static void InitChatRoomInfoItems() { int chatRoomInfoItemCount = Enum.GetValues(typeof(DummyChatRoomId)).Length; ChatRoomInformation[] dummyChatRoomInfoItems = new ChatRoomInformation[chatRoomInfoItemCount]; { DummyChatRoomId chatId = DummyChatRoomId.ChatRoomA; string[] participants = { GetPhoneNumber(DummyPhoneNumberId.ObamaCell), GetPhoneNumber(DummyPhoneNumberId.AnthonyWeinerCell) }; dummyChatRoomInfoItems[(int)chatId] = new ChatRoomInformation("chat901258305184729544", participants); } { DummyChatRoomId chatId = DummyChatRoomId.ChatRoomB; string[] participants = { GetPhoneNumber(DummyPhoneNumberId.TonyWolfCell), GetPhoneNumber(DummyPhoneNumberId.VictoriaWolfCell) }; dummyChatRoomInfoItems[(int)chatId] = new ChatRoomInformation("chat901258305184729566", participants); } { DummyChatRoomId chatId = DummyChatRoomId.ChatRoomC; string[] participants = { GetPhoneNumber(DummyPhoneNumberId.ObamaCell), GetPhoneNumber(DummyPhoneNumberId.HarryLooseTieCell), GetPhoneNumber(DummyPhoneNumberId.AnthonyWeinerCell), GetPhoneNumber(DummyPhoneNumberId.ReliableLarryOffice) }; dummyChatRoomInfoItems[(int)chatId] = new ChatRoomInformation("chat901258305184725792", participants); } { DummyChatRoomId chatId = DummyChatRoomId.ChatRoomD; string[] participants = { GetPhoneNumber(DummyPhoneNumberId.HarryLooseTieCell), GetPhoneNumber(DummyPhoneNumberId.UnknownLawnmower) }; dummyChatRoomInfoItems[(int)chatId] = new ChatRoomInformation("chat901258305184724753", participants); } foreach (ChatRoomInformation cri in dummyChatRoomInfoItems) { if (cri == null) { throw new ArgumentException("You forgot to initialize a chat room information item."); } } _DummyChatRoomInfoItems = dummyChatRoomInfoItems; }