Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (26 sloc) 0.779 kb
using System.Text;
using NUnit.Framework;
namespace EtoolTech.MongoDB.Mapper.Test.NUnit
{
[TestFixture]
public class EventsTest
{
[Test]
public void TestEvents()
{
Helper.DropAllCollections();
var c = new Country {Code = "FR", Name = "España"};
c.OnBeforeInsert += (s, e) => { ((Country) s).Name = "Francia"; };
c.Save();
var c3 = MongoMapper.FindByKey<Country>("FR");
Assert.AreEqual(c3.Name, "Francia");
}
[Test]
public void TextTest()
{
byte[] bytes = Encoding.GetEncoding("UTF-8").GetBytes("");
string s = System.Text.Encoding.UTF8.GetString(bytes);
Assert.AreEqual ("", s);
}
}
}
Jump to Line
Something went wrong with that request. Please try again.