Пример #1
0
        public void AddNewTran_GetAllBack_ShouldReturnSingleTranWithIdOf1()
        {
            var tran = new Model.Tran()
            {
                Amount       = 100,
                CollectionId = "croatia2019",
                Consumers    = new List <string>()
                {
                    "jenek", "rinat"
                },
                Contributors = new List <string>()
                {
                    "dan"
                },
                Description = "Dan bought something for jenek and rinat"
            };

            var addedTran = _sut.AppendTran(tran);

            var allTrans = _sut.ReadAllTrans("croatia2019");

            allTrans.Should().BeEquivalentTo(new[] { tran }, opts => opts.Excluding(t => t.Id).Excluding(t => t.AddedAt));
            allTrans[0].Id.Should().Be(1);
        }
Пример #2
0
        public Tran Post([FromBody] Tran tran)
        {
            var modified = _storage.AppendTran(tran);

            return(modified);
        }