@@ -73,12 +73,6 @@ public async Task Marketplace_DirectListings_CreateListing_Success()
7373 Assert . Equal ( TokenType . ERC1155 , listing . TokenTypeEnum ) ;
7474 Assert . Equal ( Status . CREATED , listing . StatusEnum ) ;
7575 Assert . Equal ( listing . Reserved , listingParams . Reserved ) ;
76-
77- var isCurrencyApproved = await contract . Marketplace_DirectListings_IsCurrencyApprovedForListing ( listingId , Constants . NATIVE_TOKEN_ADDRESS ) ;
78- Assert . True ( isCurrencyApproved ) ;
79-
80- var currencyPriceForListing = await contract . Marketplace_DirectListings_CurrencyPriceForListing ( listingId , Constants . NATIVE_TOKEN_ADDRESS ) ;
81- Assert . Equal ( currencyPriceForListing , listingParams . PricePerToken ) ;
8276 }
8377
8478 [ Fact ( Timeout = 120000 ) ]
@@ -229,6 +223,49 @@ public async Task Marketplace_DirectListings_GetListing_Success()
229223
230224 #region IEnglishAuctions
231225
226+ [ Fact ( Timeout = 120000 ) ]
227+ public async Task Marketplace_EnglishAuctions_CreateAuction_Success ( )
228+ {
229+ var contract = await this . GetMarketplaceContract ( ) ;
230+ var wallet = await this . GetSmartWallet ( 1 ) ;
231+
232+ var auctionParams = new AuctionParameters ( )
233+ {
234+ AssetContract = this . _drop1155ContractAddress ,
235+ TokenId = 0 ,
236+ Quantity = 1 ,
237+ Currency = Constants . NATIVE_TOKEN_ADDRESS ,
238+ MinimumBidAmount = 1 ,
239+ BuyoutBidAmount = BigInteger . Parse ( "1" . ToWei ( ) ) ,
240+ TimeBufferInSeconds = 3600 ,
241+ BidBufferBps = 100 ,
242+ StartTimestamp = Utils . GetUnixTimeStampNow ( ) - 3000 ,
243+ EndTimestamp = Utils . GetUnixTimeStampNow ( ) + ( 3600 * 24 * 7 ) ,
244+ } ;
245+
246+ var receipt = await contract . Marketplace_EnglishAuctions_CreateAuction ( wallet , auctionParams , true ) ;
247+ Assert . NotNull ( receipt ) ;
248+ Assert . True ( receipt . TransactionHash . Length == 66 ) ;
249+
250+ var auctionId = await contract . Marketplace_EnglishAuctions_TotalAuctions ( ) - 1 ;
251+ var auction = await contract . Marketplace_EnglishAuctions_GetAuction ( auctionId ) ;
252+ Assert . NotNull ( auction ) ;
253+ Assert . Equal ( auction . AuctionId , auctionId ) ;
254+ Assert . Equal ( auction . TokenId , auctionParams . TokenId ) ;
255+ Assert . Equal ( auction . Quantity , auctionParams . Quantity ) ;
256+ Assert . Equal ( auction . MinimumBidAmount , auctionParams . MinimumBidAmount ) ;
257+ Assert . Equal ( auction . BuyoutBidAmount , auctionParams . BuyoutBidAmount ) ;
258+ Assert . True ( auction . TimeBufferInSeconds >= auctionParams . TimeBufferInSeconds ) ;
259+ Assert . True ( auction . BidBufferBps >= auctionParams . BidBufferBps ) ;
260+ Assert . True ( auction . StartTimestamp >= auctionParams . StartTimestamp ) ;
261+ Assert . True ( auction . EndTimestamp >= auctionParams . EndTimestamp ) ;
262+ Assert . Equal ( auction . AuctionCreator , await wallet . GetAddress ( ) ) ;
263+ Assert . Equal ( auction . AssetContract , auctionParams . AssetContract ) ;
264+ Assert . Equal ( auction . Currency , auctionParams . Currency ) ;
265+ Assert . Equal ( TokenType . ERC1155 , auction . TokenTypeEnum ) ;
266+ Assert . Equal ( Status . CREATED , auction . StatusEnum ) ;
267+ }
268+
232269 [ Fact ( Timeout = 120000 ) ]
233270 public async Task Marketplace_EnglishAuctions_GetAuction_Success ( )
234271 {
@@ -262,64 +299,78 @@ public async Task Marketplace_EnglishAuctions_GetAllValidAuctions_Success()
262299 Assert . True ( auctions . Count >= 0 ) ;
263300 }
264301
302+ #endregion
303+
304+ #region IOffers
305+
265306 // [Fact(Timeout = 120000)]
266- // public async Task Marketplace_EnglishAuctions_GetWinningBid_Success ()
307+ // public async Task Marketplace_Offers_MakeOffer_Success ()
267308 // {
268309 // var contract = await this.GetMarketplaceContract();
269- // var auctionId = BigInteger.One;
270-
271- // var (bidder, currency, bidAmount) = await contract.Marketplace_EnglishAuctions_GetWinningBid(auctionId);
272- // Assert.NotNull(bidder);
273- // Assert.NotNull(currency);
274- // Assert.True(bidAmount >= 0);
310+ // var wallet = await this.GetSmartWallet(0);
311+
312+ // var offerParams = new OfferParams()
313+ // {
314+ // AssetContract = this._drop1155ContractAddress,
315+ // TokenId = 0,
316+ // Quantity = 1,
317+ // Currency = ERC20_HERE,
318+ // TotalPrice = 0,
319+ // ExpirationTimestamp = Utils.GetUnixTimeStampNow() + (3600 * 24),
320+ // };
321+
322+ // var receipt = await contract.Marketplace_Offers_MakeOffer(wallet, offerParams, true);
323+ // Assert.NotNull(receipt);
324+ // Assert.True(receipt.TransactionHash.Length == 66);
325+
326+ // var offerId = await contract.Marketplace_Offers_TotalOffers() - 1;
327+ // var offer = await contract.Marketplace_Offers_GetOffer(offerId);
328+ // Assert.NotNull(offer);
329+ // Assert.Equal(offer.OfferId, offerId);
330+ // Assert.Equal(offer.TokenId, offerParams.TokenId);
331+ // Assert.Equal(offer.Quantity, offerParams.Quantity);
332+ // Assert.Equal(offer.TotalPrice, offerParams.TotalPrice);
333+ // Assert.True(offer.ExpirationTimestamp >= offerParams.ExpirationTimestamp);
334+ // Assert.Equal(offer.Offeror, await wallet.GetAddress());
335+ // Assert.Equal(offer.AssetContract, offerParams.AssetContract);
336+ // Assert.Equal(offer.Currency, offerParams.Currency);
337+ // Assert.Equal(TokenType.ERC1155, offer.TokenTypeEnum);
338+ // Assert.Equal(Status.CREATED, offer.StatusEnum);
275339 // }
276340
277341 // [Fact(Timeout = 120000)]
278- // public async Task Marketplace_EnglishAuctions_IsAuctionExpired_Success ()
342+ // public async Task Marketplace_Offers_GetOffer_Success ()
279343 // {
280344 // var contract = await this.GetMarketplaceContract();
281- // var auctionId = BigInteger.One;
345+ // var offerId = BigInteger.One;
282346
283- // _ = await contract.Marketplace_EnglishAuctions_IsAuctionExpired(auctionId);
347+ // var offer = await contract.Marketplace_Offers_GetOffer(offerId);
348+ // Assert.NotNull(offer);
284349 // }
285350
286- #endregion
287-
288- #region IOffers
289-
290- [ Fact ( Timeout = 120000 ) ]
291- public async Task Marketplace_Offers_GetOffer_Success ( )
292- {
293- var contract = await this . GetMarketplaceContract ( ) ;
294- var offerId = BigInteger . One ;
295-
296- var offer = await contract . Marketplace_Offers_GetOffer ( offerId ) ;
297- Assert . NotNull ( offer ) ;
298- }
299-
300- [ Fact ( Timeout = 120000 ) ]
301- public async Task Marketplace_Offers_GetAllOffers_Success ( )
302- {
303- var contract = await this . GetMarketplaceContract ( ) ;
304- var startId = BigInteger . Zero ;
305- var endId = BigInteger . Zero ;
351+ // [Fact(Timeout = 120000)]
352+ // public async Task Marketplace_Offers_GetAllOffers_Success()
353+ // {
354+ // var contract = await this.GetMarketplaceContract();
355+ // var startId = BigInteger.Zero;
356+ // var endId = 10;
306357
307- var offers = await contract . Marketplace_Offers_GetAllOffers ( startId , endId ) ;
308- Assert . NotNull ( offers ) ;
309- Assert . True ( offers . Count >= 0 ) ;
310- }
358+ // var offers = await contract.Marketplace_Offers_GetAllOffers(startId, endId);
359+ // Assert.NotNull(offers);
360+ // Assert.True(offers.Count >= 0);
361+ // }
311362
312- [ Fact ( Timeout = 120000 ) ]
313- public async Task Marketplace_Offers_GetAllValidOffers_Success ( )
314- {
315- var contract = await this . GetMarketplaceContract ( ) ;
316- var startId = BigInteger . Zero ;
317- var endId = BigInteger . Zero ;
363+ // [Fact(Timeout = 120000)]
364+ // public async Task Marketplace_Offers_GetAllValidOffers_Success()
365+ // {
366+ // var contract = await this.GetMarketplaceContract();
367+ // var startId = BigInteger.Zero;
368+ // var endId = 10 ;
318369
319- var offers = await contract . Marketplace_Offers_GetAllValidOffers ( startId , endId ) ;
320- Assert . NotNull ( offers ) ;
321- Assert . True ( offers . Count >= 0 ) ;
322- }
370+ // var offers = await contract.Marketplace_Offers_GetAllValidOffers(startId, endId);
371+ // Assert.NotNull(offers);
372+ // Assert.True(offers.Count >= 0);
373+ // }
323374
324375 #endregion
325376}
0 commit comments