Skip to content

Instantly share code, notes, and snippets.

View berkdulger's full-sized avatar

Berk Dülger berkdulger

  • Istanbul, Turkey
View GitHub Profile
public class Account {
private String accountNumber;
public Account(String accountNumber){
// Constructor
this.accountNumber = accountNumber;
}
public String getAccountNumber(){
return accountNumber; // return the account number
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".
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
wcm.io
%%
Copyright (C) 2014 wcm.io
%%
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
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: