示例#1
0
        public void ItMapsHorse()
        {
            // Arrange
            var service = new HorseService(_fakeRepository);
            var horse   = new HorseCreate
            {
                Name    = "Test",
                ColorId = 1,
                Win     = 2,
                Place   = 3,
                Show    = 4,
                Starts  = 5,
                SireId  = 6,
                DamId   = 7
            };

            // Act
            service.Create(horse);
            var actual = _fakeRepository.AddCalledWith;

            // Assert
            Assert.Equal(horse.Name, actual.Name);
            Assert.Equal(horse.ColorId, actual.ColorId);
            Assert.Equal(horse.Win, actual.RaceWins);
            Assert.Equal(horse.Place, actual.RacePlace);
            Assert.Equal(horse.Show, actual.RaceShow);
            Assert.Equal(horse.Starts, actual.RaceStarts);
            Assert.Equal(horse.SireId, actual.SireId);
            Assert.Equal(horse.DamId, actual.DamId);
        }
示例#2
0
        public void ItCallsRepositorySave()
        {
            // Arrange
            var service = new HorseService(_fakeRepository);

            // Act
            service.Create(new HorseCreate());

            // Assert
            Assert.True(_fakeRepository.SaveCalled);
        }