public async Task CreateLifte_WithValidInput_ShouldBeReturnTrue() { this.liftsService = this.InitializeCategoriesService(); var isCreated = await CreateLiftAsync(this.liftsService); Assert.True(isCreated); }
public FollowsController( IDeletableEntityRepository <Follow> followRepository, IFollowsService followsService, ILiftsService liftsService, UserManager <ApplicationUser> userManager) { this.followRepository = followRepository; this.followsService = followsService; this.liftsService = liftsService; this.userManager = userManager; }
public LiftsController( ILiftsService liftService, ICitiesService cityService, IManufacturersService manufacturerService, UserManager <ApplicationUser> userManager) { this.liftService = liftService; this.cityService = cityService; this.manufacturerService = manufacturerService; this.userManager = userManager; }
public async Task GetAllLifts_WithValidInput_ShouldBeReturnCorrectData() { this.liftsService = this.InitializeCategoriesService(); await CreateLiftAsync(this.liftsService); await CreateLiftAsync(this.liftsService); await CreateLiftAsync(this.liftsService); var lifts = await this.liftsService.GetAllLifts(1, 2); Assert.NotNull(lifts); } // Triabva da se preraboti
public async Task GetLiftWithRegistrationNumber_WithValidInput_ShouldBeReturnCorrectLift() { this.liftsService = this.InitializeCategoriesService(); await CreateLiftAsync(this.liftsService); var lift = this.repository.All().FirstOrDefaultAsync().Result; var currentLift = this.liftsService.GetLiftWithRegistrationNumber(lift.RegistrationNumber); Assert.Equal(lift.RegistrationNumber, currentLift.RegistrationNumber); }
public async Task GetLiftWithRegistrationNumber_WithInvalidInput_ShouldBeReturnNull(string input) { this.liftsService = this.InitializeCategoriesService(); await CreateLiftAsync(this.liftsService); var lift = this.repository.All().FirstOrDefaultAsync().Result; var currentLift = this.liftsService.GetLiftWithRegistrationNumber(input); Assert.Null(currentLift); Assert.True(lift != currentLift); }
public InspectsController( ISupportCompaniesService supportCompaniesService, IInspectTypesService inspectTypesService, ILiftsService liftsService, IInspectsService inspectsService, UserManager <ApplicationUser> userManager) { this.supportCompaniesService = supportCompaniesService; this.inspectTypesService = inspectTypesService; this.liftsService = liftsService; this.inspectsService = inspectsService; this.userManager = userManager; }
public async Task GetLifts_WithInvalidInput_ShouldBeReturnNull(string input) { this.liftsService = this.InitializeCategoriesService(); await CreateLiftAsync(this.liftsService); var lift = this.repository.All().FirstOrDefaultAsync().Result; Assert.NotNull(lift); var getLift = this.liftsService.GetLift(input); Assert.Null(getLift); }
public async Task GetCountAllActiveLifts_WithValidInput_ShouldBeReturnCorrectCount() { this.liftsService = this.InitializeCategoriesService(); var count = this.liftsService.GetCountAllActiveLifts(); Assert.Equal(0, count); await CreateLiftAsync(this.liftsService); count = this.liftsService.GetCountAllActiveLifts(); Assert.Equal(1, count); }
public async Task AddSupportCompany__WithValidInput_ShouldBeReturnCorrectData() { this.liftsService = this.InitializeCategoriesService(); await CreateLiftAsync(this.liftsService); var lift = this.repository.All().FirstOrDefaultAsync().Result; string supportCompanyId = "SP1"; await this.liftsService.AddSupportCompany(lift.Id, supportCompanyId); Assert.Equal(supportCompanyId, lift.SupportCompanyId); }
public async Task GetCurrentLift_WithValidInput_ShouldBeReturnCorrectData() { this.liftsService = this.InitializeCategoriesService(); await CreateLiftAsync(this.liftsService); var lift = this.repository.All().FirstOrDefaultAsync().Result; Assert.NotNull(lift); var getCurrentLift = this.liftsService.GetCurrentLift(lift.Id).Result; Assert.Null(getCurrentLift); } // Triabva da se preraboti
public async Task GetLifts_WithValidInput_ShouldBeReturnCorrectCount() { this.liftsService = this.InitializeCategoriesService(); await CreateLiftAsync(this.liftsService); var lift = this.repository.All().FirstOrDefaultAsync().Result; Assert.NotNull(lift); var getLift = this.liftsService.GetLift(lift.Id); Assert.NotNull(getLift); Assert.Equal(lift.Id, getLift.Id); }
private static async Task <bool> CreateLiftAsync(ILiftsService liftsService) { string userId = "U1"; LiftType liftType = (LiftType)Enum.Parse(typeof(LiftType), "Пътнически"); int numberOfStops = 4; int capacity = 450; DoorType doorType = (DoorType)Enum.Parse(typeof(DoorType), "АВ"); string manufacturerId = "M1"; string productionNumber = "123"; string cityId = "C1"; string address = "A1"; var isCreated = await liftsService.CreateAsync(userId, liftType, numberOfStops, capacity, doorType, manufacturerId, productionNumber, cityId, address); return(isCreated); }
public async Task DeleteLift_WithValidInput_ShouldBeDeleteLift() { this.liftsService = this.InitializeCategoriesService(); await CreateLiftAsync(this.liftsService); var lift = this.repository.All().FirstOrDefaultAsync().Result; await this.liftsService.DeleteAsync(lift.Id); lift = this.repository.All().FirstOrDefaultAsync().Result; var deleteLift = this.repository.AllWithDeleted().FirstOrDefaultAsync().Result; Assert.Null(lift); Assert.NotNull(deleteLift); Assert.Equal(DateTime.UtcNow.ToShortDateString(), deleteLift.DeletedOn.Value.ToShortDateString()); }