Example #1
0
        public void CanBeConstructed()
        {
            //Arrange
            ReleaseCreatedEvent sut;

            //Act
            sut = new ReleaseCreatedEvent();

            //Assert
            Assert.NotNull(sut);
            Assert.Equal("ms.vss-release.release-created-event", ReleaseCreatedEvent.EventIdentifier);
        }
        private async void AddNewRelease(ReleaseCreatedEvent release)
        {
            var newRelease = new Release()
            {
                Id                = release.Id,
                Date              = release.Date,
                PaymentMethod     = (PaymentMethod)Enum.Parse(typeof(PaymentMethod), release.PaymentMethod),
                EstablishmentName = release.EstablishmentName,
                Amount            = release.Amount,
                CreatedAt         = release.CreatedAt,
                UpdatedAt         = release.UpdatedAt
            };

            await releaseService.CreateItem(newRelease);
        }
Example #3
0
        public void CanBeSerialized()
        {
            //Arrange
            var sut = new ReleaseCreatedEvent()
            {
                Id          = Guid.NewGuid().ToString(),
                EventType   = "MyEventType",
                PublisherId = "MyPublisherId",
                Scope       = "MyScope"
            };

            //Act
            var payload = JsonSerializer.Serialize(sut, new JsonSerializerOptions {
                IgnoreNullValues = true
            });

            //Assert
            Assert.NotNull(JsonDocument.Parse(payload));
        }
 public void On(ReleaseCreatedEvent evnt)
 {
     _releaseId = evnt.ReleaseId;
 }