public void CreateEntity_Should_Create_plane_typeof_Plane() { // Arrange PlaneDTO planeDTO = new PlaneDTO { Id = 1, ReleaseDate = new DateTime(2018, 07, 12), Name = "TY-143", PlaneTypeId = 1, Lifetime = new DateTime(2020, 07, 12) - new DateTime(2018, 07, 12) }; Plane plane = new Plane { Id = 1, ReleaseDate = new DateTime(2018, 07, 12), Name = "TY-143", PlaneTypeId = 1, Lifetime = new DateTime(2020, 07, 12) - new DateTime(2018, 07, 12) }; var planeRepository = new FakeRepository <Plane>(); var planeService = new PlaneService(planeRepository); // Act planeService.CreateEntity(planeDTO); var result = planeRepository.Get(1); // Assert Assert.AreEqual(plane, result); }
public void AddPlane() { service.CreateEntity(SelectedPlane); FillPlanesCollection(); }