{{ message }}

Instantly share code, notes, and snippets.

🏠
Working from home

# Tarik Guneytarikguney

🏠
Working from home
Last active Feb 10, 2020
Iterator Pattern Sample: Collecting money from briefcase
View iterator_pattern_sample.cs
 class Program { static void Main(){ Canta paraDoluCanta = new Canta(); var zengin = new Yazilimci(paraDoluCanta) { Isim="Tosun", Yas=21 } // Zengin birisi olarak, farkli ozelliklerimi farkli siniflar ile temsil ediyorum. // Mesela para sayma ozelligim: ParaSayar, saldiri ozelligim: HizliVeOfkeli, vs. // GetIterator() genelde standard bir isim. Onun icin kullandim. Geriye Iterator ustipinden ParaSayar tipini gonderiyor. ParaSaymaIterator paraSayanOzelligim = zengin.GetIterator(); double toplamPara = 0;
Last active Jan 12, 2021
 .login-form-flex { display: flex; justify-content: center; align-items: center; height: 100%; } .button-flex-container { display: flex; width: 100%;
Created Feb 2, 2018
View account-checker.cs
 public class AccountChecker{ public bool Exists(Account account){ //.... } public bool ExistsInAmazonWebServices(Account account){ //.... } public bool ExistsInAzure(Account account){ //....
Created Oct 8, 2017
Aggregation with inheritance
View aggregation-with-inheritance.cs
 public class Account{ private ILogin _loginInfo; private IProfile _profileInfo; public Account(IProfile profileInfo, ILogin loginInfo){ _loginInfo = loginInfo; _profileInfo = profileInfo; } }
Created Oct 8, 2017
Composition vs. Aggregation
View Aggregation.cs
 public class Account { private Profile _profileInfo; private Login _loginInfo; public Account(Profile profileInfo, Login loginInfo){ _profile = profileInfo; _loginInfo = loginInfo; } }
Created Jul 12, 2017 — forked from ijt/http_get.go
Example of using http.Get in go (golang)
View http_get.go
 package main import ( "fmt" "io" "log" "net/http" "os" )
Created Feb 3, 2017
Unit Test Example for Medium
View Unit-test-example-for-medium.cs
 public class AccountCreatorTest{ private IAccountChecker _accountCheckerMock; private IAccountRepository _accountRepositoryMock; [TestInitialize] public void Initialize(){ _accountCheckerMock = new AccountCheckerMock(); _accountRepositoryMock = new AccountRepositoryMock(); }
Last active Feb 3, 2017
Unit Testing with Dependency Injection
View unit-test-dependency-injection.cs
 public class AccountCreator{ // Interface'ler tanımlıyoruz. Dolayısıyla kendi sınıflarımızı rahatlıkla kullanabiliriz. private IAccountChecker _accountChecker; private IAccountRepository _accountRepository; // Dependency'lerimizi constructor method vasıtasıyla enjekte ediyoruz. public AccountCreator(IAccountChecker accountChecker, IAccountRepository accountRepository){ _accountChecker = accountChecker; _accountRepository = new accountRepository; }
Created Jan 31, 2017
Ninject Code Sample
View ninject-code-sample.cs
 public class WarriorModule : NinjectModule { public override void Load() { this.Bind().To(); } }
Created Jan 31, 2017
Account Creator Used in Main Method For Medium
View account-creator-used-in-main-method-medium.cs
 public class Program{ public static void Main(string[] args){ AccountCreator accountCreator = new AccountCreator(new DatabaseAccountChecker()); var accountInfo = GetAccountInfoFromSomewhere(); var result = accountCreator.TryCreateAccount(accountInfo); Console.WriteLine("Account Creation was succesfull? " + result); } }