Exemplo n.º 1
0
    public void IdenticalThroughLoadSaveCycle()
    {
        foreach (var file in Directory.GetFiles(Path.Combine(TestConstants.TestModFolder, "msg")))
        {
            var    unchangedBytes = File.ReadAllBytes(file);
            string temp           = Path.GetTempFileName();
            var    messages       = _msgService.LoadBlock(file);
            _msgService.SaveBlock(temp, messages);
            var shouldBeUnchangedBytes = File.ReadAllBytes(temp);
            File.Delete(temp);

            shouldBeUnchangedBytes.Should().Equal(unchangedBytes);
        }
    }
Exemplo n.º 2
0
        public List <Message> Retrieve(int id)
        {
            string file = Path.Combine(_mod.FolderPath, Constants.MsgBlockPathFromId(id));

            return(_msgService.LoadBlock(file));
        }