public void Count_Zero() { // arrange var descriptors = new TaskHubCollection <TaskActivity>(); // act int count = descriptors.Count; // assert count.Should().Be(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); }
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(); }
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)); }
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); }
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(); }