コード例 #1
0
        public void AddService_Should_Throw_When_FilterType_Is_Not_A_Filter()
        {
            // Act
            var collection = new CommandFilterCollection();

            // Arrange + Assert
            Assert.Throws <ArgumentException>(() =>
            {
                collection.AddService(typeof(string));
            });
        }
コード例 #2
0
        public void AddService_Should_Add_ServiceCommandFilterFactory_Of_Specified_Type(Type filterType)
        {
            // Act
            var collection     = new CommandFilterCollection();
            var expectedFilter = new ServiceCommandFilterFactory(filterType);

            // Arrange
            var filter = collection.AddService(filterType, 0);

            // Assert
            Assert.NotNull(filter);
            Assert.NotEmpty(collection);
            Assert.Contains(filter, collection);
            Assert.IsType(expectedFilter.GetType(), filter);
        }
コード例 #3
0
ファイル: Marco.cs プロジェクト: hispafox/DNA.Patterns
 /// <summary>
 /// Initialize the Macro object instance.
 /// </summary>
 public Macro()
 {
     Commands = new List<ICommand>();
     Filters = new CommandFilterCollection();
 }