-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/release' into release
- Loading branch information
Showing
162 changed files
with
1,905 additions
and
1,377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
README.md in progress... | ||
README.md in progress... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
- Исправление багов | ||
- Исправление багов | ||
- Ренейминг: теперь не SGO app, а че задали :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
210 changes: 105 additions & 105 deletions
210
app/src/androidTest/java/com/mezhendosina/sgo/app/NetSchoolUnitTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,106 @@ | ||
/* | ||
* Copyright 2023 Eugene Menshenin | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
///* | ||
// * Copyright 2023 Eugene Menshenin | ||
// * | ||
// * Licensed under the Apache License, Version 2.0 (the "License"); | ||
// * you may not use this file except in compliance with the License. | ||
// * You may obtain a copy of the License at | ||
// * | ||
// * http://www.apache.org/licenses/LICENSE-2.0 | ||
// * | ||
// * Unless required by applicable law or agreed to in writing, software | ||
// * distributed under the License is distributed on an "AS IS" BASIS, | ||
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// * See the License for the specific language governing permissions and | ||
// * limitations under the License. | ||
// */ | ||
// | ||
package com.mezhendosina.sgo.app | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import com.google.gson.Gson | ||
import com.google.gson.reflect.TypeToken | ||
import com.mezhendosina.sgo.app.netschool.api.login.entities.SchoolEntity | ||
import com.mezhendosina.sgo.data.netschool.NetSchoolExpectedResults | ||
import com.mezhendosina.sgo.data.netschool.NetSchoolSingleton | ||
import junit.framework.TestCase.assertEquals | ||
import kotlinx.coroutines.runBlocking | ||
import org.junit.After | ||
import org.junit.Before | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class NetSchoolUnitTests : NetSchoolTestInterface { | ||
|
||
private val netSchoolSingleton = NetSchoolSingleton | ||
|
||
@Before | ||
override fun login() { | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
val login = System.getenv("SGO_LOGIN") | ||
val password = System.getenv("SGO_PASSWORD") | ||
runBlocking { | ||
if (!login.isNullOrEmpty() && !password.isNullOrEmpty()) { | ||
netSchoolSingleton.loginRepository.login( | ||
appContext, | ||
login, | ||
password, | ||
89 | ||
) | ||
} else { | ||
throw RuntimeException("Login or password is null or empty") | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
override fun region() { | ||
assertEquals( | ||
NetSchoolExpectedResults.region, | ||
netSchoolSingleton.regionsRepository.getRegions() | ||
) | ||
} | ||
|
||
@Test | ||
override fun school() { | ||
runBlocking { | ||
netSchoolSingleton.loginRepository.findSchool("68") | ||
val itemsListType = object : TypeToken<List<SchoolEntity>>() {}.type | ||
assertEquals( | ||
netSchoolSingleton.schools, | ||
Gson().fromJson(NetSchoolExpectedResults.schools, itemsListType) | ||
) | ||
} | ||
} | ||
|
||
@Test | ||
override fun announcements() { | ||
runBlocking { | ||
netSchoolSingleton.announcementsRepository.announcements() | ||
} | ||
} | ||
|
||
@Test | ||
override fun attachments() { | ||
|
||
} | ||
|
||
@Test | ||
override fun grades() { | ||
} | ||
|
||
@Test | ||
override fun diary() { | ||
} | ||
|
||
@Test | ||
override fun settings() { | ||
} | ||
|
||
@After | ||
override fun logout() { | ||
} | ||
|
||
|
||
} | ||
// | ||
//import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
//import androidx.test.platform.app.InstrumentationRegistry | ||
//import com.google.gson.Gson | ||
//import com.google.gson.reflect.TypeToken | ||
//import com.mezhendosina.sgo.app.netschool.api.login.entities.SchoolEntity | ||
//import com.mezhendosina.sgo.data.netschool.NetSchoolExpectedResults | ||
//import com.mezhendosina.sgo.data.netschool.NetSchoolSingleton | ||
//import junit.framework.TestCase.assertEquals | ||
//import kotlinx.coroutines.runBlocking | ||
//import org.junit.After | ||
//import org.junit.Before | ||
//import org.junit.Test | ||
//import org.junit.runner.RunWith | ||
// | ||
//@RunWith(AndroidJUnit4::class) | ||
//class NetSchoolUnitTests : NetSchoolTestInterface { | ||
// | ||
// private val netSchoolSingleton = NetSchoolSingleton | ||
// | ||
// @Before | ||
// override fun login() { | ||
// val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
// val login = System.getenv("SGO_LOGIN") | ||
// val password = System.getenv("SGO_PASSWORD") | ||
// runBlocking { | ||
// if (!login.isNullOrEmpty() && !password.isNullOrEmpty()) { | ||
// netSchoolSingleton.loginRepository.login( | ||
// appContext, | ||
// login, | ||
// password, | ||
// 89 | ||
// ) | ||
// } else { | ||
// throw RuntimeException("Login or password is null or empty") | ||
// } | ||
// } | ||
// } | ||
// | ||
// @Test | ||
// override fun region() { | ||
// assertEquals( | ||
// NetSchoolExpectedResults.region, | ||
// netSchoolSingleton.regionsRepository.getRegions() | ||
// ) | ||
// } | ||
// | ||
// @Test | ||
// override fun school() { | ||
// runBlocking { | ||
// netSchoolSingleton.loginRepository.findSchool("68") | ||
// val itemsListType = object : TypeToken<List<SchoolEntity>>() {}.type | ||
// assertEquals( | ||
// netSchoolSingleton.schools, | ||
// Gson().fromJson(NetSchoolExpectedResults.schools, itemsListType) | ||
// ) | ||
// } | ||
// } | ||
// | ||
// @Test | ||
// override fun announcements() { | ||
// runBlocking { | ||
// netSchoolSingleton.announcementsRepository.announcements() | ||
// } | ||
// } | ||
// | ||
// @Test | ||
// override fun attachments() { | ||
// | ||
// } | ||
// | ||
// @Test | ||
// override fun grades() { | ||
// } | ||
// | ||
// @Test | ||
// override fun diary() { | ||
// } | ||
// | ||
// @Test | ||
// override fun settings() { | ||
// } | ||
// | ||
// @After | ||
// override fun logout() { | ||
// } | ||
// | ||
// | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.mezhendosina.sgo.app | ||
|
||
import android.app.Application | ||
import dagger.hilt.android.HiltAndroidApp | ||
|
||
|
||
@HiltAndroidApp | ||
class App : Application() |
Oops, something went wrong.