Beispiel #1
0
        public void Adds_a_PlaceholderStudioComponent()
        {
            var studioComponentRepository = new StudioComponentRepository();
            var placeholder = new PlaceholderStudioComponent();

            bool success = studioComponentRepository.AddPlaceholder(placeholder);

            Assert.IsTrue(success);
            Assert.IsTrue(placeholder.Id == 1);
        }
Beispiel #2
0
        public void Finds_a_StudioComponent_by_ID()
        {
            var studioComponentRepository = new StudioComponentRepository();
            var placeholder = new PlaceholderStudioComponent();

            studioComponentRepository.AddPlaceholder(placeholder);

            var foundComponent = studioComponentRepository.Find(c => c.Id == placeholder.Id);

            Assert.IsNotNull(foundComponent);
            Assert.AreEqual(placeholder, foundComponent);
        }
Beispiel #3
0
        public void Throws_exception_when_adding_a_component_with_an_existing_ID()
        {
            var studioComponentRepository = new StudioComponentRepository();
            var placeholder  = new PlaceholderStudioComponent();
            var placeholder2 = new PlaceholderStudioComponent();

            placeholder2.SetId(1);

            studioComponentRepository.AddPlaceholder(placeholder);

            Assert.ThrowsException <ArgumentException>(() =>
            {
                studioComponentRepository.AddPlaceholder(placeholder2);
            });
        }