public void Setup()
        {
            // Drivers/included
            _receiver       = Substitute.For <ITransponderReceiver>();
            _trackConverter = new TrackConverter(_receiver);
            _sorter         = new Sorter(_trackConverter);
            _checker        = new CheckForSeparationEvent();


            // System under test
            _logger         = new LogSeparationEvent(_checker);
            _warningCreator = new CreateWarning(_checker);

            // Stubs/mocks
            _ts  = Substitute.For <ITrackSpeed>();
            _tcc = Substitute.For <ITrackCompassCourse>();

            // Driver
            _controller = new Controller(_sorter, _ts, _tcc, _checker, _warningCreator, _logger);

            // Data
            _fakeRawArgs = new RawTransponderDataEventArgs(new List <string>()
            {
                "Tag123;70000;70000;1000;20180420222222222", "Tag456;68000;68000;800;20180420222222222", "Tag789;89000;89000;5000;20180420222222222"
            });

            // Assign to events
            _checker.SeperationEvents    += _checker_SeperationEvents;
            _checker.NewSeperationEvents += _checker_FinishedSeperationEvents;
        }
예제 #2
0
 public SubresourceFactory(
     ISoundCloudRawClient soundCloudRawClient,
     IPaginationValidator paginationValidator,
     ITrackConverter trackConverter,
     IUserConverter userConverter,
     IPlaylistConverter playlistConverter,
     ICommentConverter commentConverter,
     IGroupConverter groupConverter,
     IWebProfileConverter webProfileConverter,
     IConnectionConverter connectionConverter,
     IActivityResultConverter activityResultConverter,
     IApplicationConverter applicationConverter,
     IExploreCategoryConverter exploreCategoryConverter)
 {
     this.soundCloudRawClient      = soundCloudRawClient;
     this.paginationValidator      = paginationValidator;
     this.trackConverter           = trackConverter;
     this.userConverter            = userConverter;
     this.playlistConverter        = playlistConverter;
     this.commentConverter         = commentConverter;
     this.groupConverter           = groupConverter;
     this.webProfileConverter      = webProfileConverter;
     this.connectionConverter      = connectionConverter;
     this.activityResultConverter  = activityResultConverter;
     this.applicationConverter     = applicationConverter;
     this.exploreCategoryConverter = exploreCategoryConverter;
 }
예제 #3
0
 internal ExploreApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, IExploreCategoryConverter exploreCategoryConverter, ITrackConverter trackConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.paginationValidator = paginationValidator;
     this.exploreCategoryConverter = exploreCategoryConverter;
     this.trackConverter = trackConverter;
 }
예제 #4
0
 internal ExploreApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, IExploreCategoryConverter exploreCategoryConverter, ITrackConverter trackConverter)
 {
     this.soundCloudRawClient      = soundCloudRawClient;
     this.paginationValidator      = paginationValidator;
     this.exploreCategoryConverter = exploreCategoryConverter;
     this.trackConverter           = trackConverter;
 }
 public SubresourceFactory(
     ISoundCloudRawClient soundCloudRawClient,
     IPaginationValidator paginationValidator,
     ITrackConverter trackConverter,
     IUserConverter userConverter,
     IPlaylistConverter playlistConverter,
     ICommentConverter commentConverter,
     IGroupConverter groupConverter,
     IWebProfileConverter webProfileConverter,
     IConnectionConverter connectionConverter,
     IActivityResultConverter activityResultConverter,
     IApplicationConverter applicationConverter,
     IExploreCategoryConverter exploreCategoryConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.paginationValidator = paginationValidator;
     this.trackConverter = trackConverter;
     this.userConverter = userConverter;
     this.playlistConverter = playlistConverter;
     this.commentConverter = commentConverter;
     this.groupConverter = groupConverter;
     this.webProfileConverter = webProfileConverter;
     this.connectionConverter = connectionConverter;
     this.activityResultConverter = activityResultConverter;
     this.applicationConverter = applicationConverter;
     this.exploreCategoryConverter = exploreCategoryConverter;
 }
예제 #6
0
 internal MeApi(
     ISoundCloudRawClient soundCloudRawClient, 
     IPaginationValidator paginationValidator, 
     IUserConverter userConverter, 
     ITrackConverter trackConverter, 
     IPlaylistConverter playlistConverter, 
     ICommentConverter commentConverter, 
     IGroupConverter groupConverter, 
     IWebProfileConverter webProfileConverter,
     IConnectionConverter connectionConverter,
     IActivityResultConverter activityResultConverter)
     : base(
         null, 
         soundCloudRawClient, 
         paginationValidator, 
         userConverter, 
         trackConverter, 
         playlistConverter, 
         commentConverter, 
         groupConverter, 
         webProfileConverter,
         prefix)
 {
     this.connectionConverter = connectionConverter;
     this.activityResultConverter = activityResultConverter;
 }
예제 #7
0
 internal MeApi(
     ISoundCloudRawClient soundCloudRawClient,
     IPaginationValidator paginationValidator,
     IUserConverter userConverter,
     ITrackConverter trackConverter,
     IPlaylistConverter playlistConverter,
     ICommentConverter commentConverter,
     IGroupConverter groupConverter,
     IWebProfileConverter webProfileConverter,
     IConnectionConverter connectionConverter,
     IActivityResultConverter activityResultConverter)
     : base(
         null,
         soundCloudRawClient,
         paginationValidator,
         userConverter,
         trackConverter,
         playlistConverter,
         commentConverter,
         groupConverter,
         webProfileConverter,
         prefix)
 {
     this.connectionConverter     = connectionConverter;
     this.activityResultConverter = activityResultConverter;
 }
예제 #8
0
 internal TracksApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, ITrackConverter trackConverter, ISearchParametersBuilder searchParametersBuilder)
 {
     this.soundCloudRawClient     = soundCloudRawClient;
     this.paginationValidator     = paginationValidator;
     this.trackConverter          = trackConverter;
     this.searchParametersBuilder = searchParametersBuilder;
 }
 internal PlaylistConverter(IUserConverter userConverter, ITrackConverter trackConverter, ITagListConverter tagListConverter, IDateTimeConverter dateTimeConverter)
 {
     this.userConverter = userConverter;
     this.trackConverter = trackConverter;
     this.tagListConverter = tagListConverter;
     this.dateTimeConverter = dateTimeConverter;
 }
예제 #10
0
 internal PlaylistConverter(IUserConverter userConverter, ITrackConverter trackConverter, ITagListConverter tagListConverter, IDateTimeConverter dateTimeConverter)
 {
     this.userConverter     = userConverter;
     this.trackConverter    = trackConverter;
     this.tagListConverter  = tagListConverter;
     this.dateTimeConverter = dateTimeConverter;
 }
예제 #11
0
 public void SetUp()
 {
     TrackConverter = Substitute.For <Logic.Interfaces.ITrackConverter>();
     sorter         = new Sorter(TrackConverter);
     //  _uut = new Controller(sorter);
     _trackPrior   = new TrackObject("Tag123", 80000, 60000, 1000, DateTime.ParseExact("20180412111111111", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture));
     _trackCurrent = new TrackObject("Tag123", 80500, 60400, 1000, DateTime.ParseExact("20180412111322111", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture));
 }
예제 #12
0
파일: Sorter.cs 프로젝트: Gruppe19ST/ATM
        public Sorter(ITrackConverter trackconverter)
        {
            _trackconverter = trackconverter;
            _trackconverter.TrackObjectsReady += _trackconverter_TrackObjectsReady;

            _xLimit   = new int[] { 10000, 90000 };
            _altLimit = new int[] { 500, 20000 };
            _yLimit   = new int[] { 10000, 90000 };

            SortedList = new List <TrackObject>();
        }
예제 #13
0
 internal ResolveApi(
     ISoundCloudRawClient soundCloudRawClient,
     IGroupConverter groupConverter,
     IUserConverter userConverter,
     ITrackConverter trackConverter,
     IPlaylistConverter playlistConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.groupConverter      = groupConverter;
     this.userConverter       = userConverter;
     this.trackConverter      = trackConverter;
     this.playlistConverter   = playlistConverter;
 }
 internal ActivityResultConverter(
     ITrackConverter trackConverter,
     ICommentConverter commentConverter,
     IUserConverter userConverter,
     IPlaylistConverter playlistConverter,
     IDateTimeConverter dateTimeConverter)
 {
     this.trackConverter    = trackConverter;
     this.commentConverter  = commentConverter;
     this.userConverter     = userConverter;
     this.playlistConverter = playlistConverter;
     this.dateTimeConverter = dateTimeConverter;
 }
예제 #15
0
        internal AppApi(
            string applicationId, 
            IPaginationValidator paginationValidator, 
            ISoundCloudRawClient soundCloudRawClient, 
            IApplicationConverter applicationConverter,
            ITrackConverter trackConverter)
        {
            this.paginationValidator = paginationValidator;
            this.soundCloudRawClient = soundCloudRawClient;
            this.applicationConverter = applicationConverter;
            this.trackConverter = trackConverter;

            prefix = string.Format("apps/{0}", applicationId);
        }
예제 #16
0
        internal AppApi(
            string applicationId,
            IPaginationValidator paginationValidator,
            ISoundCloudRawClient soundCloudRawClient,
            IApplicationConverter applicationConverter,
            ITrackConverter trackConverter)
        {
            this.paginationValidator  = paginationValidator;
            this.soundCloudRawClient  = soundCloudRawClient;
            this.applicationConverter = applicationConverter;
            this.trackConverter       = trackConverter;

            prefix = string.Format("apps/{0}", applicationId);
        }
        public SubresourceFactoryBuilder()
        {
            var dateTimeConverter = new DateTimeConverter();
            var tagListConverter  = new TagListConverter();

            userConverter           = new UserConverter();
            applicationConverter    = new ApplicationConverter();
            trackConverter          = new TrackConverter(userConverter, tagListConverter, applicationConverter, dateTimeConverter);
            commentConverter        = new CommentConverter(userConverter, dateTimeConverter);
            playlistConverter       = new PlaylistConverter(userConverter, trackConverter, tagListConverter, dateTimeConverter);
            paginationValidator     = new PaginationValidator();
            groupConverter          = new GroupConverter(userConverter, dateTimeConverter);
            webProfileConverter     = new WebProfileConverter(dateTimeConverter);
            connectionConverter     = new ConnectionConverter(dateTimeConverter);
            activityResultConverter = new ActivityResultConverter(trackConverter, commentConverter, userConverter, playlistConverter, dateTimeConverter);
        }
예제 #18
0
        internal GroupApi(
            string groupId,
            ISoundCloudRawClient soundCloudRawClient,
            IPaginationValidator paginationValidator,
            IGroupConverter groupConverter,
            IUserConverter userConverter,
            ITrackConverter trackConverter)
        {
            this.soundCloudRawClient = soundCloudRawClient;
            this.paginationValidator = paginationValidator;
            this.groupConverter      = groupConverter;
            this.userConverter       = userConverter;
            this.trackConverter      = trackConverter;

            prefix = string.Format("groups/{0}", groupId);
        }
        public SubresourceFactoryBuilder()
        {
            var dateTimeConverter = new DateTimeConverter();
            var tagListConverter = new TagListConverter();

            userConverter = new UserConverter();
            applicationConverter = new ApplicationConverter();
            trackConverter = new TrackConverter(userConverter, tagListConverter, applicationConverter, dateTimeConverter);
            commentConverter = new CommentConverter(userConverter, dateTimeConverter);
            playlistConverter = new PlaylistConverter(userConverter, trackConverter, tagListConverter, dateTimeConverter);
            paginationValidator = new PaginationValidator();
            groupConverter = new GroupConverter(userConverter, dateTimeConverter);
            webProfileConverter = new WebProfileConverter(dateTimeConverter);
            connectionConverter = new ConnectionConverter(dateTimeConverter);
            activityResultConverter = new ActivityResultConverter(trackConverter, commentConverter, userConverter, playlistConverter, dateTimeConverter);
        }
        public SubresourceFactoryBuilder()
        {
            var dateTimeConverter = new DateTimeConverter();
            var tagListConverter  = new TagListConverter();

            userConverter           = new UserConverter();
            applicationConverter    = new ApplicationConverter();
            trackConverter          = new TrackConverter(userConverter, tagListConverter, applicationConverter, dateTimeConverter);
            commentConverter        = new CommentConverter(userConverter, dateTimeConverter);
            playlistConverter       = new PlaylistConverter(userConverter, trackConverter, tagListConverter, dateTimeConverter);
            paginationValidator     = new PaginationValidator();
            groupConverter          = new GroupConverter(userConverter, dateTimeConverter);
            webProfileConverter     = new WebProfileConverter(dateTimeConverter);
            connectionConverter     = new ConnectionConverter(dateTimeConverter);
            activityResultConverter = new ActivityResultConverter(trackConverter, commentConverter, userConverter, playlistConverter, dateTimeConverter);
            searchParametersBuilder = new CompositeSearchParametersBuilder(new IVersionDependentSearchParametersBuilder[] { new V1SearchParametersBuilder(), new V2SearchParametersBuilder() });
        }
예제 #21
0
        internal TrackApi(
            string trackId,
            ISoundCloudRawClient soundCloudRawClient,
            IPaginationValidator paginationValidator,
            ITrackConverter trackConverter,
            IUserConverter userConverter,
            ICommentConverter commentConverter)
        {
            this.trackId             = trackId;
            this.soundCloudRawClient = soundCloudRawClient;
            this.paginationValidator = paginationValidator;
            this.trackConverter      = trackConverter;
            this.userConverter       = userConverter;
            this.commentConverter    = commentConverter;

            prefix = string.Format("tracks/{0}", trackId);
        }
예제 #22
0
        internal TrackApi(
            string trackId, 
            ISoundCloudRawClient soundCloudRawClient, 
            IPaginationValidator paginationValidator, 
            ITrackConverter trackConverter, 
            IUserConverter userConverter,
            ICommentConverter commentConverter)
        {
            this.trackId = trackId;
            this.soundCloudRawClient = soundCloudRawClient;
            this.paginationValidator = paginationValidator;
            this.trackConverter = trackConverter;
            this.userConverter = userConverter;
            this.commentConverter = commentConverter;

            prefix = string.Format("tracks/{0}", trackId);
        }
예제 #23
0
        public MainWindow()
        {
            // TrackConverter that takes a TransponderReceiver and starts it
            trackConverter = new TrackConverter(TransponderReceiverFactory.CreateTransponderDataReceiver());
            // A sorter that uses the information from the TrackConverter
            sorter = new Sorter(trackConverter);
            // The logic-classes using and handling data
            ts             = new TrackSpeed();
            tcc            = new TrackCompassCourse();
            checker        = new CheckForSeparationEvent();
            warningCreator = new CreateWarning(checker);
            logger         = new LogSeparationEvent(checker);

            // Controller that delegates out the data
            controller = new Controller(sorter, ts, tcc, checker, warningCreator, logger);

            InitializeComponent();
            DataContext = new Controller(sorter, ts, tcc, checker, warningCreator, logger);
            Loaded     += new RoutedEventHandler(MainWindow_Loaded);
        }
예제 #24
0
        internal UserApi(
            string userId,
            ISoundCloudRawClient soundCloudRawClient,
            IPaginationValidator paginationValidator,
            IUserConverter userConverter,
            ITrackConverter trackConverter,
            IPlaylistConverter playlistConverter,
            ICommentConverter commentConverter,
            IGroupConverter groupConverter,
            IWebProfileConverter webProfileConverter,
            string customPrefix = null)
        {
            this.userId = userId;
            this.soundCloudRawClient = soundCloudRawClient;
            this.paginationValidator = paginationValidator;
            this.userConverter       = userConverter;
            this.trackConverter      = trackConverter;
            this.playlistConverter   = playlistConverter;
            this.commentConverter    = commentConverter;
            this.groupConverter      = groupConverter;
            this.webProfileConverter = webProfileConverter;

            prefix = string.IsNullOrEmpty(customPrefix) ? string.Format("users/{0}", userId) : customPrefix;
        }
예제 #25
0
        internal UserApi(
            string userId, 
            ISoundCloudRawClient soundCloudRawClient, 
            IPaginationValidator paginationValidator, 
            IUserConverter userConverter, 
            ITrackConverter trackConverter, 
            IPlaylistConverter playlistConverter,
            ICommentConverter commentConverter,
            IGroupConverter groupConverter,
            IWebProfileConverter webProfileConverter,
            string customPrefix = null)
        {
            this.userId = userId;
            this.soundCloudRawClient = soundCloudRawClient;
            this.paginationValidator = paginationValidator;
            this.userConverter = userConverter;
            this.trackConverter = trackConverter;
            this.playlistConverter = playlistConverter;
            this.commentConverter = commentConverter;
            this.groupConverter = groupConverter;
            this.webProfileConverter = webProfileConverter;

            prefix = string.IsNullOrEmpty(customPrefix) ? string.Format("users/{0}", userId) : customPrefix;
        }
예제 #26
0
 internal TracksApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, ITrackConverter trackConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.paginationValidator = paginationValidator;
     this.trackConverter      = trackConverter;
 }
예제 #27
0
 internal TracksApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, ITrackConverter trackConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.paginationValidator = paginationValidator;
     this.trackConverter = trackConverter;
 }