public void ExpandVisitorGroupReference_WhenReferenceIsNotFound_ShouldNotSetVisitorGroups()
        {
            // Arrange
            var subject = new ContentMap();
            var function = new ComposerContentFunction { VisitorGroupContainerID = Guid.NewGuid() };

            // Act
            subject.ExpandVisitorGroupReference(function);

            // Assert
            Assert.IsFalse(function.VisitorGroups.Any());
        }
        public void ExpandVisitorGroupReference_WhenReferenceIsNotFound_ShouldNotSetVisitorGroups()
        {
            // Arrange
            var subject  = new ContentMap();
            var function = new ComposerContentFunction {
                VisitorGroupContainerID = Guid.NewGuid()
            };

            // Act
            subject.ExpandVisitorGroupReference(function);

            // Assert
            Assert.IsFalse(function.VisitorGroups.Any());
        }
        public void ExpandVisitorGroupReference_WhenReferenceHasBeenRegistered_ShouldSetVisitorGroups()
        {
            // Arrange
            var subject = new ContentMap();
            var reference = Guid.NewGuid();
            var visitorGroups = new[] { Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() };
            var function = new ComposerContentFunction { VisitorGroupContainerID = reference };
            subject.AddVisitorGroupMap(reference, visitorGroups);

            // Act
            subject.ExpandVisitorGroupReference(function);

            // Assert
            Assert.AreEqual(3, function.VisitorGroups.Count());
            Assert.IsTrue(function.VisitorGroups.SequenceEqual(visitorGroups));
        }
        public void ExpandVisitorGroupReference_WhenReferenceHasBeenRegistered_ShouldSetVisitorGroups()
        {
            // Arrange
            var subject       = new ContentMap();
            var reference     = Guid.NewGuid();
            var visitorGroups = new[] { Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() };
            var function      = new ComposerContentFunction {
                VisitorGroupContainerID = reference
            };

            subject.AddVisitorGroupMap(reference, visitorGroups);

            // Act
            subject.ExpandVisitorGroupReference(function);

            // Assert
            Assert.AreEqual(3, function.VisitorGroups.Count());
            Assert.IsTrue(function.VisitorGroups.SequenceEqual(visitorGroups));
        }