public void MakeSamePandaFriends() { SocialNetwork socialnetwork = new SocialNetwork(); Panda panda = new Panda("goshko", "*****@*****.**", Gender.Male); socialnetwork.AddPanda(panda); socialnetwork.MakeFriends(panda, panda); }
public void HasPandaWhenItdoesNot() { SocialNetwork socialnetwork = new SocialNetwork(); Panda panda = new Panda("goshko", "*****@*****.**", Gender.Male); socialnetwork.AddPanda(panda); Assert.IsFalse(socialnetwork.HasPanda(new Panda("NOTgoshko", "*****@*****.**", Gender.Male))); }
public void AddPandaWhenPandaExists() { SocialNetwork socialnetwork = new SocialNetwork(); Panda panda = new Panda("goshko", "*****@*****.**", Gender.Male); socialnetwork.AddPanda(panda); socialnetwork.AddPanda(new Panda("goshko", "*****@*****.**", Gender.Male)); }
public void AreFriendWhenNotFriends() { SocialNetwork socialnetwork = new SocialNetwork(); Panda panda = new Panda("goshko", "*****@*****.**", Gender.Male); Panda panda2 = new Panda("goshko2", "*****@*****.**", Gender.Male); socialnetwork.AddPanda(panda); socialnetwork.AddPanda(panda2); Assert.IsFalse(socialnetwork.AreFriends(panda, panda2)); }
public void MakeFriendsTestWhenAlreadyFriends() { SocialNetwork socialnetwork = new SocialNetwork(); Panda panda = new Panda("goshko", "*****@*****.**", Gender.Male); Panda panda2 = new Panda("goshko2", "*****@*****.**", Gender.Male); socialnetwork.AddPanda(panda); socialnetwork.AddPanda(panda2); socialnetwork.MakeFriends(panda, panda2); socialnetwork.MakeFriends(panda2, panda); }
public void FriendsOfTest() { SocialNetwork socialnetwork = new SocialNetwork(); Panda panda = new Panda("goshko", "*****@*****.**", Gender.Male); Panda panda2 = new Panda("goshko2", "*****@*****.**", Gender.Male); Panda panda3 = new Panda("goshko3", "*****@*****.**", Gender.Male); Panda panda4 = new Panda("goshko4", "*****@*****.**", Gender.Male); socialnetwork.MakeFriends(panda, panda2); socialnetwork.MakeFriends(panda, panda3); socialnetwork.MakeFriends(panda,panda4); List<IPanda> friends = socialnetwork.FriendsOf(panda).ToList(); var expected = new List<IPanda> { panda2, panda3, panda4 }; Assert.IsTrue(Enumerable.SequenceEqual(expected.OrderBy(x => x.Name), friends.OrderBy(y => y.Name))); }
public void ConnectionLevel4() { SocialNetwork socialnetwork = new SocialNetwork(); Panda panda = new Panda("goshko", "*****@*****.**", Gender.Male); Panda panda2 = new Panda("goshko2", "*****@*****.**", Gender.Male); Panda panda3 = new Panda("goshko3", "*****@*****.**", Gender.Male); Panda panda4 = new Panda("goshko4", "*****@*****.**", Gender.Female); Panda panda5 = new Panda("goshko5", "*****@*****.**", Gender.Female); socialnetwork.MakeFriends(panda, panda2); socialnetwork.MakeFriends(panda2, panda3); socialnetwork.MakeFriends(panda3, panda4); socialnetwork.MakeFriends(panda4, panda5); Assert.AreEqual(socialnetwork.ConnectionLevel(panda4, panda2), 2); }
public void CheckingFemale() { Panda panda = new Panda("Ivan", "*****@*****.**", GenderType.Female); Assert.AreEqual(panda.IsMale, false); }
public void ValidateEmail() { Panda panda = new Panda("Ivan", "*****@*****.**", GenderType.Male); Assert.AreEqual(Panda.IsEmailValid("*****@*****.**"), true ); }
static void Main(string[] args) { Panda panda = new Panda("Ivan", "*****@*****.**", GenderType.Female); Console.WriteLine(panda.ToString()); }