public void Test_Profile_Collections_Are_Initialised_Correctly() { // Arrange var profileCollection = new ProfileCollection { ProfileCollectionItems = new List<ProfileCollectionItem> { new ProfileCollectionItem() } }; _builder.Setup(x => x.GetCollection(ProfileCollectionId)) .Returns(profileCollection); // Act var collections = new ProfileCollectionListBuilder(_builder.Object) .GetProfileCollections(UrlKey, new List<int> { ProfileCollectionId }); // Assert: collection var collection = collections.First(); Assert.AreEqual(1, collections.Count); Assert.AreEqual(UrlKey, collection.UrlKey, "UrlKey should have been assigned"); // Assert: collection items var collectionItems = collection.ProfileCollectionItems; Assert.AreEqual(1, collectionItems.Count()); Assert.AreEqual(collection, collectionItems.First().ParentCollection, "Parent collection should be assigned"); }
public void TestContainsProfileWithIdIsTrue() { var collection = new ProfileCollection(); collection.ProfileCollectionItems = new List<ProfileCollectionItem> { new ProfileCollectionItem{ProfileId = 2} }; Assert.IsTrue(collection.ContainsProfileWithId(2)); }
private void AddProfileDetails(ProfileCollection profileCollection) { var isLive = config.IsEnvironmentLive; foreach (var item in profileCollection.ProfileCollectionItems) { var profileDetails = new ProfileDetailsBuilder(item.ProfileId).Build(); item.ProfileDetails = profileDetails; if (profileDetails.HasExclusiveSkin) { var skin = profileReader.GetSkinFromId(profileDetails.SkinId); item.ExternalUrl = isLive ? skin.LiveHost : skin.TestHost; } } }