Exemple #1
0
 public void TestConstructor_UnknownSocialMediaType()
 {
     var id                = 10;
     var userId            = 1;
     var socialMediaTypeId = -1;
     var value             = "facebook.com/someone";
     var user              = new User(userId);
     var instance          = new SocialMediaPresenceTestClass(user, socialMediaTypeId, value, id);
 }
Exemple #2
0
        public void TestConstructor()
        {
            var id                = 10;
            var userId            = 1;
            var socialMediaTypeId = SocialMediaType.Facebook.Id;
            var value             = "facebook.com/someone";
            var user              = new User(userId);
            var instance          = new SocialMediaPresenceTestClass(user, socialMediaTypeId, value, id);

            Assert.AreEqual(socialMediaTypeId, instance.SocialMediaTypeId);
            Assert.AreEqual(value, instance.Value);
            Assert.IsInstanceOfType(instance.Create, typeof(Create));
            Assert.IsTrue(Object.ReferenceEquals(user, instance.Create.User));
        }
Exemple #3
0
        public void TestAddSocialMediaPresence()
        {
            var id                = 10;
            var userId            = 1;
            var socialMediaTypeId = SocialMediaType.Facebook.Id;
            var value             = "facebook.com/someone";
            var user              = new User(userId);
            var instance          = new SocialMediaPresenceTestClass(user, socialMediaTypeId, value, id);

            var iSocialable = new SocialableTestClass();

            Assert.AreEqual(0, iSocialable.SocialMedias.Count);

            instance.AddSocialMediaPresence(iSocialable);
            Assert.AreEqual(1, iSocialable.SocialMedias.Count);
            var addedSocialMedia = iSocialable.SocialMedias.First();

            Assert.AreEqual(socialMediaTypeId, addedSocialMedia.SocialMediaTypeId);
            Assert.AreEqual(value, addedSocialMedia.SocialMediaValue);
            Assert.IsTrue(Object.ReferenceEquals(addedSocialMedia, iSocialable.SocialMedias.First()));
        }