View login-form.component.css
.login-form-flex { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
height: 100%; | |
} | |
.button-flex-container { | |
display: flex; | |
width: 100%; |
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; |
View account-checker.cs
public class AccountChecker{ | |
public bool Exists(Account account){ | |
//.... | |
} | |
public bool ExistsInAmazonWebServices(Account account){ | |
//.... | |
} | |
public bool ExistsInAzure(Account account){ | |
//.... |
View aggregation-with-inheritance.cs
public class Account{ | |
private ILogin _loginInfo; | |
private IProfile _profileInfo; | |
public Account(IProfile profileInfo, ILogin loginInfo){ | |
_loginInfo = loginInfo; | |
_profileInfo = profileInfo; | |
} | |
} |
View Aggregation.cs
public class Account { | |
private Profile _profileInfo; | |
private Login _loginInfo; | |
public Account(Profile profileInfo, Login loginInfo){ | |
_profile = profileInfo; | |
_loginInfo = loginInfo; | |
} | |
} |
View http_get.go
package main | |
import ( | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" | |
) |
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(); | |
} | |
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; | |
} |
View ninject-code-sample.cs
public class WarriorModule : NinjectModule | |
{ | |
public override void Load() | |
{ | |
this.Bind<IWeapon>().To<Sword>(); | |
} | |
} |
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); | |
} | |
} |
NewerOlder