public void Configure_is_called_during_initialization()
 {
     var spyProfile = new SpyProfile();
     Translator.AddProfile(spyProfile);
     Translator.ApplyUpdates();
     Assert.IsTrue(spyProfile.ConfigureWasCalled);
 }
        public void Get_all_profiles_returns_all_profiles()
        {
            var basicProfile = new BasicProfile();
            var basicProfile2 = new BasicProfile2();
            var spyProfile = new SpyProfile();

            Translator.AddProfile(basicProfile);
            Translator.AddProfile(basicProfile2);
            Translator.AddProfile(spyProfile);

            var profiles = Translator.GetAllProfiles().ToList();

            CollectionAssert.Contains(profiles, basicProfile);
            CollectionAssert.Contains(profiles, basicProfile2);
            CollectionAssert.Contains(profiles, spyProfile);
        }
        public void Remove_profile_removes_the_correct_profile()
        {
            var basicProfile = new BasicProfile();
            var basicProfile2 = new BasicProfile2();
            var spyProfile = new SpyProfile();
            var defaultNameProfile = new DefaultNameProfile();

            Translator.AddProfile(basicProfile);
            Translator.AddProfile(basicProfile2);
            Translator.AddProfile(spyProfile);
            Translator.AddProfile(defaultNameProfile);

            // by generic
            Translator.RemoveProfile<BasicProfile>();
            Translator.ApplyUpdates();
            var profiles = Translator.GetAllProfiles().ToList();
            CollectionAssert.DoesNotContain(profiles, basicProfile);
            Assert.AreEqual(3, profiles.Count());

            // by instance
            Translator.RemoveProfile(basicProfile2);
            Translator.ApplyUpdates();
            profiles = Translator.GetAllProfiles().ToList();
            CollectionAssert.DoesNotContain(profiles, basicProfile2);
            Assert.AreEqual(2, profiles.Count());

            // by profile name
            Translator.RemoveProfile(spyProfile.ProfileName);
            Translator.ApplyUpdates();
            profiles = Translator.GetAllProfiles().ToList();
            CollectionAssert.DoesNotContain(profiles, spyProfile);
            Assert.AreEqual(1, profiles.Count());
        }