Ejemplo n.º 1
0
        public void GetCow()
        {
            var newCow = new CreateCowCommand
            {
                FarmId = Guid.NewGuid(),
                State  = CowState.Pregnant
            };
            var cow    = CowsApi.ApiV1CowsPost(newCow);
            var result = CowsApi.ApiV1CowsIdGet(cow.Id);

            Assert.Equal(newCow.FarmId, cow.FarmId);
            Assert.Equal(newCow.State, cow.State);
            Assert.Equal(cow.FarmId, result.FarmId);
            Assert.Equal(cow.State, result.State);
            Assert.Equal(cow.Id, result.Id);
        }
Ejemplo n.º 2
0
        public void DeleteCow()
        {
            var newCow = new CreateCowCommand
            {
                FarmId = Guid.NewGuid(),
                State  = CowState.Inseminated
            };
            var cow    = CowsApi.ApiV1CowsPost(newCow);
            var result = CowsApi.ApiV1CowsIdGet(cow.Id);

            Assert.Equal(newCow.FarmId, cow.FarmId);
            Assert.Equal(newCow.State, cow.State);
            Assert.Equal(cow.FarmId, result.FarmId);
            Assert.Equal(cow.State, result.State);
            Assert.Equal(cow.Id, result.Id);

            CowsApi.ApiV1CowsIdDelete(cow.Id);
            result = CowsApi.ApiV1CowsIdGet(cow.Id);
            Assert.Null(result);
        }