Skip to content

Instantly share code, notes, and snippets.

View ahmetozlu's full-sized avatar
💭
I may be slow to respond.

Ozlu ahmetozlu

💭
I may be slow to respond.
View GitHub Profile
package com.ahmet.springboot.helloworld.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloWorldController {
@RequestMapping("/")
public String printHelloWorld() {
return "I just want to say hello -- Spring Boot!";
package mytest;
public class Loan {
private double annualInterestRate;
private int numberOfYears;
private double loanAmount;
private java.util.Date loanDate;
/** Default constructor */
public Loan() {
package mytest;
import org.junit.*;
import static org.junit.Assert.*;
public class LoanTest {
@Before
public void setUp() throws Exception {
}
package mytest;
import org.junit.*;
import static org.junit.Assert.*;
import java.util.*;
public class ArrayListTest {
private ArrayList<String> list = new ArrayList<String>();
@Before
public void setUp() throws Exception {
package mytest;
import org.junit.*;
import static org.junit.Assert.*;
public class ATest {
@Test
public void m1() {
// Write a test method
}
var BurgerMenuOrder = artifacts.require('BurgerMenuOrder');
contract('BurgerMenuOrder', function(accounts) {
var seller = null;
var customer = null;
var orderno = null;
var invoiceno = null;
var price = null;
// function to send order
function sendOrder(string memory burgerMenu, uint quantity) payable public {
// only the customer can use this function
require(msg.sender == customerAddress);
// increase the order index
orderseq++;
// create the order
orders[orderseq] = Order(orderseq, burgerMenu, quantity, 0, 0, 0, 0, true);
// event triggers when order sent
event OrderSent(address customer, string burgerMenu, uint quantity, uint orderNo);
// event triggers when price sent
event PriceSent(address customer, uint orderNo, uint price);
// event triggers when safe payment sent
event SafePaymentSent(address customer, uint orderNo, uint value, uint now);
// event triggers when invoice sent
// BurgerMenuOrder constructor
constructor(address _buyerAddr) public payable {
owner = msg.sender;
customerAddress = _buyerAddr;
}
// mapping for orders to have an list for the orders
mapping (uint => Order) orders;
// mapping for invoices to have an list for the invoices
mapping (uint => Invoice) invoices;
// index value of the orders
uint orderseq;
// index value of the invoices