Skip to content

Instantly share code, notes, and snippets.

View NikiforovAll's full-sized avatar
🇺🇦

Oleksii Nikiforov NikiforovAll

🇺🇦
View GitHub Profile
public class ObjectHierarchyManager {
//TBD: move custom settings to wrapper config object
private Map<String, Mapper_Object_Settings__c> dmlSettings;
private String mappingName;
public ObjectHierarchyManager(String mappingName) {
this.mappingName = mappingName;
fetchDmlSettings();
}
@isTest
public class ObjectHierarchyManagerTest {
@isTest
private static void testBasicHierarchyInsert(){
insertObjectMappingSettings(1);
Account acc = new Account(Name = 'Test');
Account acc2 = new Account(Name = 'Test2');
List<Contact> contactList = new List<Contact>{
new Contact(LastName = 'Contact1'),
@NikiforovAll
NikiforovAll / tools.gti
Created April 22, 2019 15:27
NikiforovAll. dotnet global tools.
//dotnet tool install gti -g
//payload
tools.gti
Id,Version,FeedUri
coverlet.console,1.5.0,
dotnet-cleanup,0.5.2,
dotnet-depends,0.3.0,
dotnet-doc,1.0.4,
dotnet-outdated,2.2.0,
dotnet-script,0.28.0,
@NikiforovAll
NikiforovAll / Program.cs
Last active May 27, 2019 15:30
design-patterns-playground : Strategy
using System;
using Strategy;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
ILogReader logReader;
// log storage number one
using System;
using TemlateMethod;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
var items = new [] { 1, 2, 3, 4, 5 };
AbstractClass processor = new ConcreteProcessor1();
using System;
using System.Collections.Generic;
namespace Mediator {
/// <summary>
/// The 'Mediator' abstract class
/// </summary>
public abstract class AbstractChatroom {
public abstract void Register (User user);
public abstract void Send (string from, string to, string message);
using System;
using System.Collections;
using System.Collections.Generic;
namespace Iterator {
public class ConcreteIterator<T> : Iterator.Iterator<T> {
public ConcreteIterator (CustomCollection<T> collection) {
_collection = collection;
}
using System;
using System.Collections.Generic;
namespace Observer {
public class ConcreteObserver : Observer {
public string State { get; private set; }
public override void Update (Subject state) {
State = (state as ConcreteSubject).SubjectState;
}
@NikiforovAll
NikiforovAll / Program.cs
Last active June 9, 2019 10:38
VisitorImpl
using System;
using Visitor;
public class Program {
public static void Main () {
var baseEntry = new SimpleLogEntry () {
Created = DateTime.Now,
Message = "test"
};
@NikiforovAll
NikiforovAll / CommandImpl.cs
Last active June 9, 2019 11:07
CommandImpl
using System;
using System.Collections.Generic;
namespace Command {
public class Calculator {
private int _curr = 0;
public int CurrentResult { get => _curr; set => _curr = value; }
public int Operate (char @operator, int operand) {