Example #1
0
            public void SendProperItems_ReturnEmptyValidationErrorArray()
            {
                //Arrange
                var feedProcessor = new DeltaOneFeedProcessor(new AccountRepository());
                var list          = FeedInitializer.DeltaOneFeedInitialize();

                //Act
                var actualResult = feedProcessor.Validate(list[0]);

                //Assert
                CollectionAssert.IsEmpty(actualResult);
            }
Example #2
0
            public void SendFeedItemOfAnotherType_ReturnArgumentException()
            {
                //Arrange
                var feedProcessor = new DeltaOneFeedProcessor(new AccountRepository());

                //Assert
                Assert.Throws <ArgumentException>(() =>
                {
                    //Act
                    feedProcessor.Validate(new EmFeed());
                });
            }
Example #3
0
            public void SendNull_ReturnArgumentException()
            {
                //Arrange
                var feedProcessor = new DeltaOneFeedProcessor(new AccountRepository());

                //Assert
                Assert.Throws <ArgumentNullException>(() =>
                {
                    //Act
                    feedProcessor.Validate(null);
                });
            }
Example #4
0
            public void SendItemWithDefaultIntegerOfIsin_ReturnArrayWithOneValidationError()
            {
                //Arrange
                var feedProcessor = new DeltaOneFeedProcessor(new AccountRepository());

                //Act
                var actualResult = feedProcessor.Validate(new DeltaOneFeed()
                {
                    MaturityDate = DateTime.Now
                });

                //Assert
                CollectionAssert.IsNotEmpty(actualResult);
            }
Example #5
0
            public void SendItemWithDefaultDatetimeOfMaturnityDate_ReturnArrayWithOneValidationError()
            {
                //Arrange
                var feedProcessor = new DeltaOneFeedProcessor(new AccountRepository());

                //Act
                var actualResult = feedProcessor.Validate(new DeltaOneFeed()
                {
                    Isin = 123
                });

                //Assert
                CollectionAssert.IsNotEmpty(actualResult);
            }