コード例 #1
0
        public void DeleteFromCache()
        {
            IAppCache cache = new CachingService();

            var profiles = cache.GetProfiles(
                () => new List <ProfileNameAndSdp>()
            {
                new ProfileNameAndSdp()
                {
                    Name = "Profile 1", Sdp = "Sdp A"
                },
                new ProfileNameAndSdp()
                {
                    Name = "Profile 2", Sdp = "Sdp B"
                },
                new ProfileNameAndSdp()
                {
                    Name = "Profile 3", Sdp = "Sdp C"
                }
            });

            Assert.IsNotNull(profiles);
            Assert.AreEqual(3, profiles.Count);
            Assert.AreEqual("Profile 3", profiles[2].Name);

            cache.ResetProfiles();

            var sameProfiles = cache.GetProfiles(null);

            Assert.IsNull(sameProfiles);
        }