Skip to content

Instantly share code, notes, and snippets.

using UserEMailNotificationSender.BL;
using UserEMailNotificationSender.Model;
namespace UserEMailNotificationSender
{
class Program
{
static void Main(string[] args)
{
User aUser = new User("TheUser", "the_user@mail_service.com", false);
using UserEMailNotificationSender.Infrastucture;
using UserEMailNotificationSender.Model;
namespace UserEMailNotificationSender.BL
{
class SMTPNotificationSender
{
SMTPClient smtpClient = new SMTPClient();
public void sendNotificationForUser(User userToNotify)
using Core.Interfaces;
using Core.Model;
namespace Core.Services
{
public class NotificationService
{
SendMail sendMail;
public NotificationService(SendMail _sendMail)
namespace Core.Interfaces
{
public interface SendMail
{
void sendMail(string recipient, string subject, string message);
}
}
using Core.Model;
using Core.Services;
using Infrastucture.Services;
using System;
namespace UserEMailNotificationSender
{
public class Program
{
static void Main(string[] args)
[TestMethod]
public void isNonPremiumUserMailSentAndValid()
{
var user = new User("A", "A@B.com", false);
var expectedSubject = "Notification";
var expectedMessage = "Dear A this is a Notification!";
var sendMail = Mock.Create<SendMail>();
new NotificationService(sendMail).sendNotificationForUser(user);
interface SensorDevice
{
void powerOff();
void enable();
void disable();
bool isEnabled();
DateTime isEnabledSince();
int getFirmwareVersion();
long getSystemUptime();
int getLastReading();
namespace SensorDevices
{
public interface SensorDevice : DeviceControl, DeviceState, SensorReading
{}
public interface DeviceControl
{
void powerOff();
int getFirmwareVersion();
long getSystemUptime();
using SensorDevices;
using FakeSensors;
using System;
namespace Console_SensorDevice_Test
{
static class Program
{
static void Main()
{
private async void DoWhoisLookup()
{
EnableInput(false);
try
{
var googleWhoisLookup = new WhoisLookup(tbHostToLookup.Text);
// initiate HTTP request asynchronously
Task<string> getWhoisInfoTask = googleWhoisLookup.GetWhoisInformationsAsync();