Skip to content

Instantly share code, notes, and snippets.

View MongkonEiadon's full-sized avatar
🏠
Working from home

Mongkon Eiadon MongkonEiadon

🏠
Working from home
  • Tech Lead @Ascend Commerce,
  • Thailand
View GitHub Profile
This file has been truncated, but you can view the full file.
{
data: "UEsDBBQACAgIANUOf1oAAAAAAAAAAAAAAAAeAAAAbW9uZ2tvbi5laWFAYXNjZW5kY29ycC5jb20uaWNz7L17k9vWsS/6f6r8HRClrvcri4OFN2RLMUiC0liaR2ZGUuxSlQskQRJ8ABg8SI1OnVuxk9p2svetW/dse+fYSTnX9k25rlOuSpzk7NG3mdqfYH+E070AckASHIEaUkNLSmRpBmgs9GqstfrXvbp7lc1b27vX71eMu+Zu1Th47Qf7B3vV7ep1srV1y/PafZvbdhuTnytW33abVsCpfEnnZWlry9x97Qf3zYPD7b3d60KJf+0H0NIhtnb91oF5a+9g2wCCHfPo9l71+v698t3tw9uv/eBn5MEBAaJdY8e8PvDcds9zS7ZjvWWFDWi/4QV+qeENUsKj7R3z3b1d87oROtZW2ULy3ms/KCecj+++9oOjd4HvaZqfkbvbFXJ3r2IcIYN5DRweGdjxKj6/V6sdmke1g72d6//Eqzx/fu1o7/wK4/rWztE/qa/9oHoEzx8cXac63KQ8PeLZ/177AUgz0zT+luF0AetuZAWNyGlYW1Vr6ITz7M8RXHkXzPvm7tGkjTfuG3fvmTeqxpF5XeAFbE7Am/Ds/C3Kp8/t7OMVmRdFeLcmSxJ997Uf3AOBUFGVeN6QSMWsGkQq12pE1zSeyKpJK5VKWatSAwbcgQmNVqENqlNo6IiKPC/r0MZd4/CI7MBwrm2z+0LaP5UXJRHuH5o/vWfuVszrwAnwcXTv8Hplb7e2fbBjQocP7+3sGAfvXN+1R5w5tN0IBHdg7B7uX0/+MQ5Y139GjP39uyaBi/fNu8So3t8+3Dt4h5TN28b97b2D68a9o70d+ICVidCMu8bBzms/MCrJV71X3d7Dtrdv3TIPrpP9IyqP5wijRFFU9LJGK6pCRN7QiaSqJjEMVSCmKtAqFUTe1GkitGKUxtGRUbmdfpR7B9vXKx0vaJ73pmrWjHt3jxIGoMP3TOT3zu7eg7tm9daMNKmI0
public abstract class Test
{
...
protected IFixture Fixture { get; private set; }
[SetUp]
public void Setup()
{
@MongkonEiadon
MongkonEiadon / ExtendManagerTest.cs
Last active July 12, 2019 08:40
Sample model and the manager
public class DepositsManagerTest : TestFor<DepositsManager>
{
[SetUp]
public void Setup() { }
[Test]
public void QueryService_ShouldRecevied_GetAccountQuery_WithNormalStyle()
{
// arrange
var mockQueryService = new Mock<IBookingQueryService>();
@MongkonEiadon
MongkonEiadon / BingoTest.cs
Created March 4, 2019 06:41
Test_ByMongkon_Eiadon
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
namespace Bingo
{
class Program
{
static void Main(string[] args)
public interface IRepository<TEntity> : IRepository<TEntity, Guid>
where TEntity : class, IEntity
{
}
public interface IRepository<TEntity, TPrimaryKey>
where TEntity : class, IEntity<TPrimaryKey>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PP.Core;
using PP.Core.Logging;
using PP.Core.Models;
using PP.Libraries.Models;
@MongkonEiadon
MongkonEiadon / packages.config
Created April 6, 2017 09:06
install these package for sample bot builders
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Autofac" version="4.4.0" targetFramework="net462" />
<package id="Chronic.Signed" version="0.3.2" targetFramework="net462" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net462" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net462" />
<package id="Microsoft.Bot.Builder" version="3.0.0" targetFramework="net462" />
<package id="Microsoft.Bot.Connector" version="1.1.0.0" targetFramework="net462" />
<package id="Microsoft.IdentityModel.Protocol.Extensions" version="1.0.2.206221351" targetFramework="net462" />
<package id="Microsoft.Rest.ClientRuntime" version="1.8.2" targetFramework="net462" />
@MongkonEiadon
MongkonEiadon / AppSettingModule.cs
Created April 4, 2017 07:37
Register the reader and the configuration models
public class AppSettingModule : Autofac.Module {
protected override void Load(ContainerBuilder builder) {
builder.RegisterType<ConfigurationReader>().As<IConfigurationReader>().SingleInstance();
builder.Register(c => c.Resolve<IConfigurationReader>().Load<BotConfiguration>()).As<IBotConfiguration>();
// Register future model here...
}
}
@MongkonEiadon
MongkonEiadon / BotConfiguration.cs
Created April 4, 2017 07:25
Model mapped the configuration
public interface IBotConfiguration {
string AppId { get; set; }
string AppPasseord { get; set; }
}
public class BotConfiguration : IBotConfiguration {
[AppSetting("AppPassword")]
public string AppId { get; set; }
[AppSetting("AppId", "AnyDefaultValueAppId")]
@MongkonEiadon
MongkonEiadon / AppSettingAtrribute.cs
Created April 4, 2017 07:17
Attribute for to read configuration and the reader to read application setting file (app/web.config)
using System;
using System.Linq;
public class AppSettingAttribute : Attribute
{
public string Name { get; }
public string DefaultValue { get; }
public AppSettingAttribute(string name)
{