Esempio n. 1
0
        public ActionCollectionTest()
        {
            _fixture = new Fixture();

            _jsonConvertible  = Substitute.For <IJsonConvertible>();
            _schemaValidation = Substitute.For <IJsonSchemaValidation>();
            _convertible      = Substitute.For <Mozilla.IoT.WebThing.Convertibles.IConvertible>();
            _factory          = Substitute.For <IActionInformationFactory>();

            _collection = new ActionCollection(_jsonConvertible, _schemaValidation, _convertible, _factory);
        }
 /// <summary>
 /// Initialize a new instance of <see cref="ActionCollection"/>.
 /// </summary>
 /// <param name="inputConvertible">The <see cref="IJsonConvertible"/>.</param>
 /// <param name="inputValidation"></param>
 /// <param name="actionInformationFactory">The <see cref="IActionInformationFactory"/>.</param>
 /// <param name="convertible"></param>
 public ActionCollection(IJsonConvertible inputConvertible,
                         IJsonSchemaValidation inputValidation,
                         IConvertible convertible,
                         IActionInformationFactory actionInformationFactory)
 {
     _actionInformationFactory = actionInformationFactory ?? throw new ArgumentNullException(nameof(actionInformationFactory));
     _convertible      = convertible ?? throw new ArgumentNullException(nameof(convertible));
     _inputValidation  = inputValidation ?? throw new ArgumentNullException(nameof(inputValidation));
     _inputConvertible = inputConvertible ?? throw new ArgumentNullException(nameof(inputConvertible));
     _actions          = new ConcurrentDictionary <Guid, ThingActionInformation>();
 }