public void RefreshTokenNotExists_Correct() { //Arrange var campaignDbContext = new CampaignDbContext(); var dbService = new ClientServiceDb(AppData.Configuration, campaignDbContext); var controller = new ClientController(dbService); //Act var res = controller.RefreshToken("138c3168-2e76-463d-8665-adwqeq4211"); //Assert Assert.IsNotNull(res); var r = (BadRequestObjectResult)res; Assert.True(r.StatusCode == 400); }
public void LoginExistingUser_NotCorrectData() { //Arrange var campaignDbContext = new CampaignDbContext(); var dbService = new ClientServiceDb(AppData.Configuration, campaignDbContext); var controller = new ClientController(dbService); var res = controller.Login(new LoginRequest { Login = "******", Password = "******" }); //Assert Assert.IsNotNull(res); var r = (BadRequestObjectResult)res; Assert.True(r.StatusCode == 400); Assert.NotNull(r.Value); }
public void CreateCampaignBuilingsNotOnTheSameStreet_Correct() { //Arrange var campaignDbContext = new CampaignDbContext(); var dbService = new ClientServiceDb(AppData.Configuration, campaignDbContext); var controller = new ClientController(dbService); //Act var res = controller.CreateCampaign(new CreateCampaignRequest { IdClient = 2, StartDate = new DateTime(2020, 1, 1), EndDate = new DateTime(2020, 3, 1), FromIdBuilding = 3, ToIdBuilding = 6, PricePerSquareMeter = 40 }); //Assert Assert.IsNotNull(res); var r = (BadRequestObjectResult)res; Assert.True(r.StatusCode == 400); }
public void RegisterExistingUser_Correct() { //Arrange var campaignDbContext = new CampaignDbContext(); var dbService = new ClientServiceDb(AppData.Configuration, campaignDbContext); var controller = new ClientController(dbService); //Act var res = controller.Register(new RegisterRequest { FirstName = "Mike", LastName = "Paul", Email = "*****@*****.**", Login = "******", Password = "******", Phone = "+48041241" }); //Assert Assert.IsNotNull(res); var r = (BadRequestObjectResult)res; Assert.True(r.StatusCode == 400); }