Hello everyone, This is the first Software TestingSeriesarticle. I am going to explain about why we should write tests for the software and how many types of tests we can write. To add any additional information, you can email me via article[at]cinarr[dot]com. Let’s get started to explain.
Today, I am going to introduce a new tutorial series about software testing. Software testing is a pretty big topic (with frameworks and scenarios) but I am thinking about writing the following list. Hopefully it might help you to figure something about the topic and they can be useful notes for myself :).
In this post, I am going to create an automatic build trigger via Jenkins Jobs. Basically, after pushing a new piece of code to the target repository/branch, Jenkins will create a new build package from the updated source code. If Jenkins has not been installed yet in your environment, I had explained “How to install Jenkins” in one of the previous articles. If you want to read it, you can access it from here.
In this post, I am going to implement IHttpClientFactory to the Azure Function App and inject it to the sample function. To be able to do this, the Azure Function App should have a Startup.cs file. If your app does not have a Startup.cs file, you can use the sample from this article.
The aim of this post is to show the proxies.json file usage for the Azure Function Apps. It might be possible to use for different cases. For this case, the proxy will return some extra response headers from the function requests.
In early July I started to re-develop my latest project with Blazor. I would say, I learned lots of things about Blazor with this project. In this article, I have tried to explain ‘how to make two way binding in Blazor‘
2 months ago, I decided to use ubuntu OS. Windows is easier than ubuntu (for now) but the storage problem started to be an unmanageable problem for me on Windows. For now, I would say everything is perfect. (Expect permission problems.)
After Ubuntu, some installations and configurations might look different or hard. Because of that, I decided to write a blog about those topics. It is like a note for me in the future 🙂 First topic is Ubuntu. This week, I am going to write about the following topics.
How to install Jenkins on Ubuntu,
How to get build after every GitHub commit,
How to publish build to FTP via Jenkins.
If you don’t have Java on your system, you have to install Java before Jenkins installation. For Java installation, you have to run following commands on your Ubuntu terminal.
sudo apt update
sudo apt install openjdk-8-jdk
After installation to check your Java installation, you can run the following command.
After completing Java installation, everything is ready for Jenkins installation. Firstly we have to add the Jenkins repository key to Ubuntu. For this, please run the following command.
This command returns us an alphanumeric password on terminal. This command returns us an alphanumeric password on the terminal. We copy this password and paste it to Jenkins page. After clicking the Continue button on this page, we see Get Started page. In this page you can choose suggested plugins or you can choose your plugins. I chose suggested plugins and continued my installation. After this step, you might wait 1 – 2 mins for installation.
After successful installation on this page, registration screens receive us. On this screen, we are going to create a Jenkins user. We have to fill all the fields on this page and continue to Save and Continue button for this.
Last 2 steps before seeing Dashboard! After registration, we see the instance configuration screen. I am installing Jenkins to my OS. Because of that, I am going to use the default url on my install. (http://localhost:8080) I did not change anything on this screen and clicked Save and Finish button.
Last screen just for information. Jenkins is ready to use. You can click Start using Jenkins and login with your username / password.
In this post we installed Jenkins to Ubuntu. In the next post, we are going to add one item to Jenkins and configure builds via GitHub account.
I’m going to try how to develop an application which is support more than one language. I’m going to support two language in my example application. English and Turkish. The main language will be English. Its mean, application going to be English on guest’s first visit. Users can update their language from main page in this application. After changed language, I’m going to set a new cookie for selected language. Expired time is going to be 365 days for my example application. Let’s get start to code it!
In the first step, I’m going to create a new folder in project root for my language files. The folder’s name is Resources. After creating folder, I’m going to add two resources file for my languages. First one is Global. It’s for my main (default) language. Second one is Global.tr It’s for Turkish language. The screenshot for this step is as follows.
Now, I’m going to fill out Global and Global.tr files. I should define texts in this files which texts I want to use for multiple language. Name column should be same for all resources file because application will use this column as a key for texts. My example file’s screenshot is as follows.
Now, I’m going to use defined texts in my project files. For this, I’m going to add my resources’ namespace in my file. After added namespace, I can use texts in my file now. I’m going to use as follows syntax for call my values. This step is the hardest step for this example.
The example is as follows.
Everything is ready after defined all texts in the resources files. Let’s handle this in our application. How is going to application catch the language? How is going to change? I’m going to add as follows code block in the Global.asax file for detect the language.
What is going to do this code block? When application start, It’s going to read default language value from the web.config file and then It’s going to check cookie. (I said this at the beginning of the article.) If cookie’s value is not null or empty, It’s going to use user’s language. If It’s null, It’s going to use default language for the current user.
How am I going to change the language on the front end?
I’m going to add two image button for change the language. The screenshot is as follows.
If user click any flag, I’m going to set a value for the selected language in the language cookie. I’m going to use Jquery for this. The example code block is as follows.
Now, everything is ready for support to multiple languages. (English and Turkish) You can add a third language via same scenario. (Global.culture)
An extra information: I used as follows code for get/set cookie operations. You can use as follows too.
I added this to my current project. Because of that I can’t share any sample code for this example.
See you in the next post.
Thank you 🙂
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.