Esempio n. 1
0
        public void Count_Zero()
        {
            // arrange
            var descriptors = new TaskHubCollection <TaskActivity>();

            // act
            int count = descriptors.Count;

            // assert
            count.Should().Be(0);
        }
Esempio n. 2
0
        public void Add_Succeeds()
        {
            // arrange
            var activity    = new TaskActivityDescriptor(typeof(TestActivity));
            var descriptors = new TaskHubCollection <TaskActivity>();

            // act
            bool result = descriptors.Add(activity);

            // assert
            result.Should().BeTrue();
            descriptors.Should().HaveCount(1);
            descriptors.Single().Should().Be(activity);
        }
Esempio n. 3
0
        public void Get_Null()
        {
            // arrange
            var activity    = new TaskActivityDescriptor(typeof(TestActivity));
            var descriptors = new TaskHubCollection <TaskActivity>()
            {
                activity,
            };

            // act
            Type actual = descriptors["DNE", string.Empty];

            // assert
            actual.Should().BeNull();
        }
Esempio n. 4
0
        public void Get_ByName()
        {
            // arrange
            var activity    = new TaskActivityDescriptor(typeof(TestActivity));
            var descriptors = new TaskHubCollection <TaskActivity>()
            {
                activity,
            };

            // act
            Type actual = descriptors[activity.Name, activity.Version];

            // assert
            actual.Should().NotBeNull();
            actual.Should().Be(typeof(TestActivity));
        }
Esempio n. 5
0
        public void Count_Multiple()
        {
            // arrange
            var activity    = new TaskActivityDescriptor(typeof(TestActivity));
            var activity2   = new TaskActivityDescriptor(typeof(TestActivity2));
            var descriptors = new TaskHubCollection <TaskActivity>()
            {
                activity,
                activity2,
            };

            // act
            int count = descriptors.Count;

            // assert
            count.Should().Be(2);
        }
Esempio n. 6
0
        public void Enumerator_ContainsAll()
        {
            // arrange
            var activity    = new TaskActivityDescriptor(typeof(TestActivity));
            var descriptors = new TaskHubCollection <TaskActivity>()
            {
                activity,
            };

            // act
            IEnumerator enumerator = ((IEnumerable)descriptors).GetEnumerator();

            // assert
            enumerator.Should().NotBeNull();
            enumerator.MoveNext().Should().BeTrue();
            enumerator.Current.Should().Be(activity);
            enumerator.MoveNext().Should().BeFalse();
        }