Exemple #1
0
        static void Main(string[] args)
        {
            LocationReader.ImportLocations();

            var chooseGatherer = new ChooseGathererView();

            chooseGatherer.Show();

            var view = new GathererConsoleControls();

            view.Show();

            Console.ReadKey();
        }
Exemple #2
0
        public void ParsesASeriesOfLocations()
        {
            // given
            var locationsJson =
                @"[{""x"":3.4,""y"":1.3,""id"":""testLocation1""},{""x"":44.331,""y"":877,""id"":""testLocation2""}]";

            // when
            var parsedJson = new LocationReader().Read(locationsJson).ToList();

            // then
            Assert.AreEqual(3.4, parsedJson.First().X);
            Assert.AreEqual(1.3, parsedJson.First().Y);
            Assert.AreEqual("testLocation1", parsedJson.First().Id);

            Assert.AreEqual(44.331, parsedJson.Last().X);
            Assert.AreEqual(877, parsedJson.Last().Y);
            Assert.AreEqual("testLocation2", parsedJson.Last().Id);
        }
Exemple #3
0
        private async Task RaiseLocationAddedEvent(LocationCreatedEvent createdLocation, LocationReader locationAdded, CancellationToken cancellationToken)
        {
            var e = new LocationAddedEvent(locationAdded)
            {
                AggregateId  = createdLocation.AggregateId,
                Aggregate    = createdLocation.Aggregate,
                DataAsJson   = locationAdded.ToJson(),
                MajorVersion = createdLocation.MajorVersion,
                MinorVersion = ++createdLocation.MinorVersion,
                Name         = createdLocation.Name
            };

            await _mediator.Publish(e, cancellationToken);
        }