Skip to content

Instantly share code, notes, and snippets.

View berkdulger's full-sized avatar

Berk Dülger berkdulger

  • Istanbul, Turkey
View GitHub Profile
package Restassured;
import io.restassured.RestAssured;
import io.restassured.response.ValidatableResponse;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import static io.restassured.RestAssured.given;
import static io.restassured.config.XmlConfig.xmlConfig;
import static io.restassured.http.ContentType.JSON;
Code Smells Within Classes
CommentsThere's a fine line between comments that illuminate and comments that obscure. Are the comments necessary? Do they explain "why" and not "what"? Can you refactor the code so the comments aren't required? And remember, you're writing comments for people, not machines.Long MethodAll other things being equal, a shorter method is easier to read, easier to understand, and easier to troubleshoot. Refactor long methods into smaller methods if you can.Long Parameter ListThe more parameters a method has, the more complex it is. Limit the number of parameters you need in a given method, or use an object to combine the parameters.Duplicated codeDuplicated code is the bane of software development. Stamp out duplication whenever possible. You should always be on the lookout for more subtle cases of near-duplication, too. Don't Repeat Yourself!Conditional ComplexityWatch out for large conditional ulogic blocks, particularly blocks that tend to grow larger or change significantly over tim
package Restassured;
import io.restassured.RestAssured;
import io.restassured.response.ValidatableResponse;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import static io.restassured.RestAssured.given;
import static io.restassured.config.XmlConfig.xmlConfig;
import static io.restassured.http.ContentType.JSON;
@berkdulger
berkdulger / Reverse String - C# Tests
Created July 2, 2021 11:49
Reverse String - C# Kata
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ReverseString.Tests
{
[TestClass]
public class ReverseStringTests
{
private ReverseString reverseString;
@berkdulger
berkdulger / Reverse String - C#
Created July 2, 2021 11:48
Reverse String - C# Kata
Reverse String
Modify the Reverse() function in the ReverseString project to return a string that is the reverse of the inputed string value
Example:
An input value "Hello, World!" should return as "!dlroW ,olleH".
static String theTestPageURL = "http://www.keytorc.com/seleniumTraining/findByPlayground.php";
static WebDriver driver;
@BeforeClass
public static void createDriverAndVisitTestPage(){
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")
+"//chromedriver" );
driver = new ChromeDriver();
driver.get(theTestPageURL);
}
Introduction to Web Services
HTTP Protocol
Web Services - Key Terminology
SOAP Web Services
RESTful Web Services
SOAP vs RESTful Comparison
Understand Modern Microservices Architecture
The Traditional Monolith Application
What are Microservices?
Adopting Microservices in Your Organization
RomanToDecimal
Content:
Problem description
TDD approaches
Problem description
The Kata says you should write a function to convert from Roman Numerals to decimal numerals. In order to keep the kata light, we will not check for valid Roman Numeral.
Roman numerals, the numeral system of ancient Rome, uses combinations of letters from the Latin alphabet to signify values. They are based on seven symbols:
@berkdulger
berkdulger / CodeReviewExercise
Created January 16, 2020 08:54 — forked from pauldambra/CodeReviewExercise
For a Code Review exercise
using System.Collections.Generic;
using System.Linq;
namespace CodeReviewExercise
{
using System;
using Serilog;
public class Customer
{
@berkdulger
berkdulger / csharpCodeSample.cs
Last active January 14, 2020 12:43
Code Review for a Sample C# Code
public IEnumerable<GitHubUser> FavoritesList()
{
CookieHelper cookieHelper = new CookieHelper(this.HttpContext);
HttpCookie httpCookie = cookieHelper.SetAndGetHttpCookies();
MyCookie myCookie = new MyCookie()
{
ID = Convert.ToInt32(httpCookie["userId"])
};
List<GitUser> favoritesList = new List<GitUser>();